I am just playing around with Ruby on Rails 3.0 with a simple message board and found several issues with will_paginate.
The most pressing is that each time a new page is displayed a database query of every single post in the topic is performed.
As you can imagine, if you have a topic with 10,000+ posts this is very slow.
Is there a way to stop this odd behavior?
Show controller:
@[email protected]
@posts = Post.paginate @posts, :page => params[:page],:order => "post_number"
Model
cattr_reader :per_page
@@per_page = 20
view
<%= will_paginate @posts %>