I am displaying some data on one of my pages by calling a for loop:
for comment in @comments
and then diplaying it:
<%= link_to comment.send(‘comment_subject’), :controller =>‘comments’ ,
:action => ‘show’, :id => comment, :class => ‘comment’ %>
Works great, but it displays things from oldest to newest… Is there an
easy way to get it to reverse the order so that the newest comments are
on the top?
–
“To fully realize the potential of Rails, it’s crucial that you take
the time to fully understand Ruby–and with “Ruby for Rails” David
has provided just what you need to help you achieve that goal.”
– DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS.
Complete foreword & sample chapters at Ruby for Rails!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.