In this code:
function load_part_price_select(id, value) {
// alert(id);
// alert(value);
$('#' + id ).live('change',function() {
$.ajax({
url: '/parts/' + value + '/price',
type: 'get',
context: this,
dataType: 'script',
success: function(responseData) {
// alert('success: ' + responseData);
$(this).nextAll("span.price:first").html(responseData);
}
});
});
};
...why do you have:
dataType: 'script',
I doubt your action is responding to the ajax request by sending a
string with js code in it back to your page--because your action looks
like this:
def retrieve_part_price
@price = Part.find(params[:id])
respond_to do |format|
format.html { redirect_to(items_path)}
format.js { render :nothing => true }
end
end
It looks like you are trying to send a price back, so you should
specify:
dataType: 'text'
But then I don't understand how your action returns anything because you
wrote this:
format.js { render :nothing => true }
I think that should be render :text.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.