How do I sort the outcome of my for-loop in ruby on rails

Posted by Angela on Stack Overflow See other posts from Stack Overflow or by Angela
Published on 2010-04-19T22:17:10Z Indexed on 2010/04/19 22:23 UTC
Read the original article Hit count: 171

Filed under:

I have a loop as follows:

<% for email in @campaign.emails%>
    <strong>Email: </strong><%=h email.title %> sent after <%=h email.days %> days </br>
<% end %>

But actually I want it sorted by the email.days value when it displays to the screen.

How do I do that?

© Stack Overflow or respective owner

Related posts about ruby-on-rails