Want to do a checkboxes for has_many :through. Railscast in 2007 recommends this: check_box_tag “product[category_ids][]”, category.id, @product.categories.include?(category). Is this still relevant or is there a more natural way using form_for to do this in rails 3?
Want to do a checkboxes for has_many :through. Railscast in 2007 recommends this: check_box_tag
Share
My recommendation is to check out Justin French’s Formtastic gem: https://github.com/justinfrench/formtastic
It makes working with forms in rails really easy and intuitive.
Your form might look like this:
Much simpler then looping through and using the check box tag.
Once you go formtastic you never go back.