Descending sort order w/paginate?


#1

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?


#2

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