Return to Snippet

Revision: 20700
at November 23, 2009 11:36 by smoothdzion


Updated Code
<% for category in Category.find(:all) %>
  <%= check_box_tag "post[category_ids][]", category.id, @post.categories.include?(category) %>
  <%= category.name %><br />
<% end %>

Revision: 20699
at November 23, 2009 11:34 by smoothdzion


Initial Code

                                

Initial URL

                                

Initial Description
Used to create checkboxes to select multiple categories for a post or any other type of applicable situation.

Initial Title
RoR - Snippet for Join Table Checkboxes

Initial Tags
rails, ruby

Initial Language
Rails