/ Published in: Rails
Used to create checkboxes to select multiple categories for a post or any other type of applicable situation.
Expand |
Embed | Plain Text
<% for category in Category.find(:all) %> <%= check_box_tag "post[category_ids][]", category.id, @post.categories.include?(category) %> <%= category.name %><br /> <% end %>
You need to login to post a comment.
