Posted By

smoothdzion on 11/23/09


rails ruby ror views

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


RoR - Snippet for Join Table Checkboxes

 / Published in: Rails

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

  1. <% for category in Category.find(:all) %>
  2. <%= check_box_tag "post[category_ids][]",, @post.categories.include?(category) %>
  3. <%= %><br />
  4. <% end %>

Report this snippet  

You need to login to post a comment.