sunny
February 23, 2007, 4:01am
1
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 ??
sunny
February 23, 2007, 4:44am
2
nvm … I found the problem
sunny
February 23, 2007, 5:01am
3
Swaraj S. 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
Redirecting... ← NOT a blog!!!
sunny
March 31, 2007, 6:21pm
4
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]
sunny
April 2, 2007, 2:33am
5
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.