Hello,
I have following code in my view
--------------------------------------------------------------
#plan_discount
%table
%tr
%td
="Discount Code"
%td
=text_field_tag 'discount_code'
%td
=link_to_remote "Apply", :update => "result", :url => {
:action => "discount_code"}, :with => "'discount='+
$(discount_code).value"
#result
//Here I display processed value based on value entered in
"discount_code" //textfield
------------------------------------------------------------------
When user enter the value in discount code textfield, I process it and
display it in "result" div
My problem is that in controllers
How can I get value of "discount" which is passed as a parameter in
above link_to_remote function
def discount_code
discount_code = params[:discount] # I tried this , but get nil value
puts discount_code
render :text => discount_code
end
What is the right way to do this?
Thanks,
Vikas
--
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
-~----------~----~----~----~------~----~------~--~---