Ruby on Rails: default will_paginate on last page of results

Is there an easy way, by default will_paginate on the last page? I would like to show the last addition of the user and allow viewing the pages of previous results ...

+5
source share
3 answers
0
source

Just request your request in reverse chronological order.

Post.paginate(:page => (params[:page] || 1), :per_page => 20 :order => "created_at desc")
+1
source

- , ..

    :order => 'created_at DESC'

paginate-. " " .

+1
source

All Articles