documentation

This commit is contained in:
Akira Matsuda 2011-02-12 01:20:48 +09:00
parent 2a7514a53e
commit 07b5405f54
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,12 @@
== 0.9.6
* added paginates_per method for setting default per_page value for each model
in a declarative way
Example:
class Article < ActiveRecord::Base
paginates_per 10
end
== 0.9.5
* works on AR 3.0.0 and 3.0.1 now #4 [danillos]

View File

@ -49,6 +49,14 @@ To show a lot more users per each page (change the per_page value)
User.page(7).per(50)
Note that the :per scope is not directly defined on the models but is just a method defined on the page scope. This is absolutely reasonable because you will never actually use "per_page" without specifying the "page" number.
=== Configuring default per_page value for each model
* paginates_per
You can specify default per_page value per each model using the following declarative DSL.
class User
paginates_per 50
end
=== Controllers
* the page parameter is in params[:page]