Forum: Ruby on Rails How to pass Radio Button selection to the controller ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0cf7e6818ec02aea59a76c638b492bfe?d=identicon&s=25 Swaraj Shergill (sunny)
on 2007-02-23 04:01
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",, 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 ??
0cf7e6818ec02aea59a76c638b492bfe?d=identicon&s=25 Swaraj Shergill (sunny)
on 2007-02-23 04:44
nvm .. I found the problem :)
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-02-23 05:01
(Received via mailing list)
Swaraj Shergill wrote:

> nvm .. I found the problem :)

Please tell us what the solution was. Otherwise, you just left a false
in the archives. They are important because nothing else documents most
the hard details around here!

  Phlip <-- NOT a blog!!!
7bf509ba8ae3d8ec2c4822c34a0828f7?d=identicon&s=25 Tarek Elganainy (Guest)
on 2007-03-31 18:21
(Received via mailing list)
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 <>
7c8f8b6eae4dd991e3a9065c68451361?d=identicon&s=25 Wai Tsang (sneptune)
on 2007-04-02 02:33
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.
This topic is locked and can not be replied to.