Last active
August 29, 2015 14:02
-
-
Save rafamvc/e698958fba52abf0dd70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% categories_column_size = (categories.size / 4).ceil %> | |
<div class="row"> | |
<% # the false on the next line removes the nils you used to protect with the if category %> | |
<% categories.in_groups_of(categories_column_size, false) do |n_categories| %> | |
<div class="large-3 columns"> | |
<% n_categories.each do |category| %> | |
<div class="row"> | |
<div class="large-10 columns"> | |
<%= label_tag category.name, category.name, class: 'right inline' %> | |
</div> | |
<div class="large-2 columns"> | |
<%= check_box_tag "categories[#{category.id}]", "1", false, class: 'left inline' %> | |
</div> | |
</div> | |
<% end %> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment