Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Multiple check box with has many
<%= form_for(@user) do |f| %>
<div class="user_container">
<%= f.label :intrests %>
<% Interest.all.each do |interest| %>
<label class="li">
<%= check_box_tag :intrest_ids,, @user.interests.include?(interest), :name => 'user[intrest_ids][]' %> <u><%= intrest.title %></u>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment