Have a look at the Enumerable class: http://ruby-doc.org/core/classes/Enumerable.html each_slice in particular looks likely what you need.

Walter

On Nov 4, 2010, at 10:59 PM, Dv Dasari wrote:

I have an array "$a" and the below code in my view displays all the
elements in a single column. How do I display them into 5 columns?

I am not sure if it should be done thru ruby code, or html tags or CSS.
Please suggest. thanks

<ul>
<% for w in $a %>
<%= w %>
<% end %>
</ul>

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails- [email protected]. To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to