I have a big collection of items I want to display two columns of
ordered lists. I’m pretty new to RoR, but I think there must be some
way to do this with a helper.
this is the code i want to split
<% @items.each do |item| %>
- <%= item.name %>
<% end %>
Thx!
Quoting…
in_groups_of
Have you ever wanted to visually line up items in rows and columns?
The in_groups_of method makes this a cinch.
<% @tasks.in_groups_of(4, false) do |row_tasks| %>
<% for task in row_tasks %>
<% end %>
<% end %>
Philip H. wrote:
http://railscasts.com/episodes/28
Quoting…
in_groups_of
Have you ever wanted to visually line up items in rows and columns?
The in_groups_of method makes this a cinch.
The only problem with in_groups_of is that the ordering goes horizontal.
If you are looking for vertical ordering, read this thread
http://www.ruby-forum.com/topic/137230
Peace,
Phillip