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 ??

nvm … I found the problem :slight_smile:

Swaraj S. wrote:

nvm … I found the problem :slight_smile:

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
Redirecting... ← NOT a blog!!!

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 S. [email protected]

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.