views:

164

answers:

2

Is there any simple way to reverse page numeration with will_paginate?

I want for the top page (last time-wise) to be #1, and the last (earliest) to be #N.

The reason for that is page contents shouldn't change with time, which is good for SEO.

A: 

I'm not sure I understand. If the oldest content is #N, then when there's new content, the oldest content will be pushed to #N+1 and the page contents would change. That sounds like it's the opposite of what you're looking for?

You can pass :order => "column ASC" or :order => "column DESC" to paginate to determine what ends up on page #1.

cpm
A: 

Order your query by an ascending date instead of a descending date

def index
  @posts = Post.paginate :page => params[:page], :order => "created_at ASC"
end
Ryan McGeary
Shit, it's really that simple. All I have to do is customize the paginator template so it reverses the visible order of pages.
Leonid Shevtsov