Displaying 2 results from an estimated 2 matches for "get_pric".
Did you mean:
get_price
2011 Sep 07
4
jquery and ajax query in rails 3
hi people
I don''t know much about ajax - jquery. And right now I need to use
some functionality with them.
In a form (sales model) I have the following code:
<div>
<%= f.label :product_id, "Product" %>
<%= f.collection_select( :product_id, Product.all, :id, :name,
options={} ) %>
</div>
<div>
<%= f.label :price,
2011 Sep 09
0
respond_with and ajax
Suppose I have this controller:
class SalesController < ApplicationController
respond_to ?????
def get_price
@price = Product.find(params[:product_id]).price
respond_with ?????
end
end
1) What do I specify for respond_to() so that get_price() will accept
ajax requests?
2) What do I specify for respond_with() if all I want to do is return
@price?
--
Posted via http://www.ruby-forum.com/.
-...