Swaraj Shergill
2007-Feb-23 03:01 UTC
How to pass Radio Button selection to the controller ?
Hey guys, I have a loop that generates multiple radio buttons, here''s the code: <% checked = true %> <% for address in @customer.addresses %> <%= radio_button_tag("address", address.id, checked = checked) %> <% checked = false %> <% end %> <%= link_to ''Confirm Order >>'', :controller => ''store'', :action => ''confirm_order'', :customer_id => @customer , :address_id = ????? %> How can I pass the selected address button to the controller ?? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Swaraj Shergill
2007-Feb-23 03:44 UTC
Re: How to pass Radio Button selection to the controller ?
nvm .. I found the problem :) -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Swaraj Shergill wrote:> nvm .. I found the problem :)Please tell us what the solution was. Otherwise, you just left a false trail in the archives. They are important because nothing else documents most of the hard details around here! -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tarek Elganainy
2007-Mar-31 16:20 UTC
Re: How to pass Radio Button selection to the controller ?
please send me the solution cz i face the same proplem & please copy the mail to my private mail cz i dont check the group On Feb 23, 5:01 am, Swaraj Shergill <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hey guys, I have a loop that generates multipleradiobuttons, here''s > the code: > > <% checked = true %> > <% for address in @customer.addresses %> > <%= radio_button_tag("address", address.id, checked = checked) > %> > <% checked = false %> > <% end %> > > <%= link_to ''Confirm Order >>'', :controller => ''store'', :action => > ''confirm_order'', :customer_id => @customer , :address_id = ????? %> > > How can I pass the selected addressbuttonto the controller ?? > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Wai Tsang
2007-Apr-02 00:33 UTC
Re: How to pass Radio Button selection to the controller ?
The simplest way is to use a form submit instead. (You can refer to the selection with params[:address].) If using form is not acceptable, you may create a javascript that would update the URL when the radio buttons are clicked. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---