Is there an easy way, to default will_paginate to last page? I would like to show user latest addition and allow to browse previuos pages of results...
Just order your query so that it's in reverse chronological order.
Post.paginate(:page => (params[:page] || 1), :per_page => 20 :order => "created_at desc")
The proper way to do it is to reverse the sorting order, i.e. add
:order => 'created_at DESC'
to your paginate call. User would expect the "latest addition" on the beginning, and older ones on the following pages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With