I think it is better to pass the parameter to the :total_entriesmethod paginate:
@posts = Post.paginate(:page => params[:page], :per_page => 30,
:total_entries => 1000)
will_paginate , 1000 .
, :
if params[:page].to_i * 30 <= 1000
@posts = Post.paginate(:page => params[:page], :per_page => 30,
:total_entries => 1000)
end
, :total_entries, sql COUNT, , .