Forum: Ruby on Rails descending sort order w/paginate?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cfe056e9a33b9d8fe39f97df9582c6e4?d=identicon&s=25 steve (Guest)
on 2005-11-13 15:56
(Received via mailing list)
How do you do a descending sort with paginate?
My current code looks something like this:

  @note_pages, @notes =
    (paginate :note,
     :per_page => 20,
     :conditions => 'is_log = 0',
     :order_by => 'logged_at')

I'd thought maybe ':descending => true' would work, but that's not it
(unknown option: descending), and I haven't found a list of options in
the
rails docs, has anyone yet come across this?
5fc52b212d554dd8e0337bf27a5187f3?d=identicon&s=25 lee.marlow (Guest)
on 2005-11-13 15:56
(Received via mailing list)
Just stick 'DESC' in your order_by option

   @note_pages, @notes =
     (paginate :note,
      :per_page => 20,
      :conditions => 'is_log = 0',
      :order_by => 'logged_at DESC')

-Lee
This topic is locked and can not be replied to.