Displaying 1 result from an estimated 1 matches for "checkox".
Did you mean:
checkbox
2010 Oct 07
0
has many relation in a form
Hi,
I have 2 models, group and user.
A group has many users and a user belongs to a group.
In my new group form, I want a checkox list with all my users and get
all the checked users.
How do I do this in the form?
<%= form_for(@group) do |f| %>
...
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<% @users.each do |user| %>...