I have a list of users that have requested access to my application.
They appear in a table inside a view:
<table>
<thead>
<th>Company</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Role</th>
<th>Action</th>
</thead>
<% for ar in @brand.access_requests %>
<% user = ar.user %>
<tr id="user_<%= user.id %>">
<td><%= user.company %></td>
<td><%= user.first_name %></td>
<td><%= user.last_name %></td>
<td><%= user.email %></td>
<td><%= collection_select :role, :id, Role.all, :id, :name %></td>
<td><%= link_to "Create", brand_responsibilities_path(@brand), { :remote => true, :method => :post } %></td>
</tr>
<% end %>
</table>
So I want to assign a Role to each user, then approve that user.
Obviously this does not work, because I do not know how to refer to the "role_id" field from my link_to.
How do I include a value from another field in my link_to? Is there a way to do a ":with" or something like that? I want to pass whatever is chosen in the select box to:
brand_responsibilities_path(@brand)
I know it would work if I created a form for every single row, but is that overkill, or the Rails Way? Any help is seriously appreciated.