I just play with Ruby on Rails 3.0 with a simple bulletin board and have found a few problems with will_paginate.
The most important thing is that every time a new page is displayed, a query is made to the database of each individual message in the subject.
As you can imagine, if you have a topic with 10,000 + posts, this is very slow.
Is there any way to stop this odd behavior?
Show controller:
@posts=@topic.posts
@posts = Post.paginate @posts, :page => params[:page],:order => "post_number"
Model
cattr_reader :per_page
@@per_page = 20
View
<%= will_paginate @posts %>
source
share