Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Feb 22, 2011
1 parent f9f529f commit 3c44a21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
@@ -1,3 +1,9 @@
== 0.10.2

* Added :param_name option to the pagination helper #10 [ivanvr]
Example:
= paginate @users, :param_name => :pagina

== 0.10.1

* Fixed a bug that the whole <nav> section was not rendered in some cases
Expand Down
11 changes: 8 additions & 3 deletions README.rdoc
Expand Up @@ -47,16 +47,16 @@ Then bundle:

=== Query Basics

* the +:page+ scope
* the +page+ scope

To fetch the 7th page of users (default +per_page+ is 25)
User.page(7)

* the +:per+ scope
* the +per+ scope

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.
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

Expand Down Expand Up @@ -100,6 +100,11 @@ Then bundle:
<%= paginate @users, :left => 0, :right => 2 %>
This would output something like <tt>1 ...(snip)... 18 19 20</tt> while having 20 pages in total.

* changing the parameter name (:+param_name+) for the links

<%= paginate @users, :param_name => :pagina
This would modify the query parameter name on each links.

* extra parameters (:+params+) for the links

<%= paginate @users, :params => {:controller => 'foo', :action => 'bar'}
Expand Down

0 comments on commit 3c44a21

Please sign in to comment.