Hi,
I have a list of companies for a given user. One (and only one) company
can be a default company for that user. I have a radio button that
appears on each row in the list of companies (here is my code):
<% form_tag :action => 'update_default_company', :id => @company,
:method => :post do %>
<table>
<tr>
<th><%= "Name" %></th>
<th><%= "Size" %></th>
<th><%= "Default Company" %></th>
</tr>
<% for @company in @companies %>
<tr>
<td><%= @company.name %></td>
<td><%= @company.size %></td>
<td><%= radio_button("company", "default_company", true) %>
</tr>
<% end %>
</table>
<%= submit_tag "Change Default" %>
<% end %>
>From this list, the user is allowed to change the default company and
click on a button (implemented with a submit tag, which calls a method
in the controller). The radio buttons are the only editable field on
this form.
Question: How do I get the necessary values back to the controller?
Currently, I only get the selected radio button, but not the associated
company data.
TIA,
TMac
--
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
-~----------~----~----~----~------~----~------~--~---