I recently had a problem getting checkboxes to work for a has_and_belongs_to_many (HABTM) association in Rails 4. I was able to find the information on how to get it working
This is all you need to do for the form: Don't do it manually when there is a built in helper.
<%= form_for @kennel do |f| %> <%= f.collection_check_boxes(:handler_ids, Handler.all, :id, :to_s) %> <% end %>