I'm new to RoR so apologies if the answer is super simple. I'm trying to create a table that allows users to select other users that can collaborate on a wiki. The issue I'm having is that no matter which checkbox you select on the table. It only toggles the topmost option.
here is the code in question:
<%= form_for [@wiki, @wiki.collaborators.build] do |f| %>
<table class="bordered hoverable">
<tbody>
<% @users.each do |user| %>
<tr>
<td><%= user.name %></td>
<td class="right-align"><%= f.check_box :user_id %><%= f.label :user_id, "Give Access" %></td>
</tr>
<% end %>
</tbody>
</table><br /><br />
the controller values in new
def new
@wiki = Wiki.find(params[:wiki_id])
@collaborator = Collaborator.new
@users = (User.all - [current_user])
end
Any help would be appreciated. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire