documentation
This commit is contained in:
parent
2a7514a53e
commit
07b5405f54
|
@ -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
|
== 0.9.5
|
||||||
|
|
||||||
* works on AR 3.0.0 and 3.0.1 now #4 [danillos]
|
* works on AR 3.0.0 and 3.0.1 now #4 [danillos]
|
||||||
|
|
|
@ -49,6 +49,14 @@ To show a lot more users per each page (change the per_page value)
|
||||||
User.page(7).per(50)
|
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.
|
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
|
=== Controllers
|
||||||
|
|
||||||
* the page parameter is in params[:page]
|
* the page parameter is in params[:page]
|
||||||
|
|
Loading…
Reference in New Issue