[Rails] Re: Looping Technique?

Florian Groß florgro at gmail.com
Sun Jan 30 18:51:52 GMT 2005


Michael Raidel wrote:

> You can reverse an array with the reverse-method before you pass it to the
> each-method:
> 
> <% @posts.reverse.each do |post| %>

Minor suggestion: Use the .reverse_each form which does the same without 
constructing an intermediate Array.



More information about the Rails mailing list