I'm trying to use radio buttons to make administrators approve users. So in the page I have a list for all the users waiting for approval (a true/false value in user model). After the administrator has set "yes" or has left "no" on the radio button field of all of them, he should press the unique submit button.
I'm trying to figure out how to pass to the controller all of the users for the approval update.`
<%= form_tag(approve_url, :html => { class: "form-inline"} )do |f| %>
<table>
<% @tobeapproved.each do |user| %>
<tr >
<td>
<%= user.name %>
</td>
<td>
<%= user.surname %>
</td>
<td>
<%= user.email %>
</td>
<td>
<%= label :approved %>
<%= radio_button_tag "approved[#{user.id}]", "true" %> Approved
<%= radio_button_tag "approved[#{user.id}]", "false" %> Not approved
</td>
</tr>
<% end %>
</table>
<%= f.submit %>
<% end %>
On submit I should get "approved[id]"=>{"true/false"} right? I'm very new on all of this. Thank you
rails server
orruby script/server
. The top of each output shows you the params. It will answer a lot of your questions. Post that here if you have problems understanding/ manipulating that. – Anil