Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Feb 11, 2011
1 parent 2a7514a commit 07b5405
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
@@ -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]
Expand Down
8 changes: 8 additions & 0 deletions README.rdoc
Expand Up @@ -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]
Expand Down

0 comments on commit 07b5405

Please sign in to comment.