How to split query results in two columns? Noob

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

<ol> <% @items.each do |item| %> <li><a href="<%= item.id %>"><%= item.name %></a></li> <% end %> </ol>

Thx!

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

<ol> <% @items.each do |item| %> <li><a href="<%= item.id %>"><%= item.name %></a></li> <% end %> </ol>

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/index.rhtml --> <table> <% @tasks.in_groups_of(4, false) do |row_tasks| %>    <tr>      <% for task in row_tasks %>        <td><%= task.name %></td>      <% end %>    </tr> <% end %> </table>

Philip Hallstrom wrote:

</ol>

#28 in_groups_of - RailsCasts

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

Peace, Phillip