On 17 Sep 2009, at 13:21, Vikas Gholap wrote:


Hi all,

How can i use form_remote_tag inside the form_tag helper .


forms cannot be nested. I imagine you could skip the second form and wire up the ajax request straight to a button.

Fred
My application has  following view subscribe.html.haml

- form_tag :action => :subscribe do

 /other form element
 %input{:type=>'radio', :name=>'tariff_plan_id', :value=>"monthly"}
 %input{:type=>'radio', :name=>'tariff_plan_id', :value=>"yearly"}



- form_remote_tag(:update => "result_discount_code", :url => { :action
=> :discount_code }, :position => "top" ) do

   =text_field 'discount_code'
   =submit_tag 'Apply Discount'

 #result_discount_code



 =submit_tag 'Subscribe'


Can I use form_remote_tag inside the form_tag?


When user hit 'Apply Discount' button i will perform following steps

get the value of radio button "tariff_plan_id" and from this value
get the value from "discount_code" textbox.

perform some operations on these value and
result is show in "result_discount_code" div.

There are two radio buttons. so user can select one of them see what
discount he will get.

Is this a right way to doing 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
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to