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

    <% @items.each do |item| %>
  1. <%= item.name %>
  2. <% end %>

Thx!

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.

<% @tasks.in_groups_of(4, false) do |row_tasks| %> <% for task in row_tasks %> <% end %> <% end %>
<%= task.name %>

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs