lundi 29 décembre 2014

How to manually group Radio Buttons Rails 4

I have 2 radio button in line for each table row. I need for them to work in a way that on 1 button in each row that can be clicked. Here's code where only one per column can only be selected due to rails automatically grouping them if they have same name attribute



...<tbody>
<% users_in_group(params[:group_id], params[:event]).each do |user| %>
<tr>
<td><%= user.fname + " "+user.lname %></td>
<td>fill</td>
<td>fill</td>
<td><%= radio_button_tag 'project[absent_user_ids][]', user.id, false %></td>
<td><%= radio_button_tag 'project[tardy_user_ids][]', user.id, false %></td>
</tr>
<%end%>
</tbody>...


Problem here is that I DO NOT want to change name parameter due to me having to re-implement the controller all over again... I will take answers if you can help me make check boxes behave in similar way.





Aucun commentaire:

Enregistrer un commentaire