Repository is archived
No commit activity in last 3 years
No release in over 3 years
Simple pagination - without changes in controllers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Display options:

:previous_label -- default: "« Previous" (this parameter is called :prev_label in versions 2.3.2 and older!)
:next_label -- default: "Next »"
:page_links -- when false, only previous/next links are rendered (default: true)
:inner_window -- how many links are shown around the current page (default: 4)
:outer_window -- how many links are around the first and the last page (default: 1)
:separator -- string separator for page HTML elements (default: single space)
:controls -- display controls only at the :top or :bottom of the pagination block (default: :both)
:per_page -- number of items displayed per page (default: 10)

HTML options:

:class -- CSS class name for the generated DIV (default: "pagination")
:container -- toggles rendering of the DIV container for pagination links, set to false only when you are rendering your own pagination markup (default: true)
:id -- HTML ID for the container (default: nil). Pass +true+ to have the ID automatically generated from the class name of objects in collection: for example, paginating
ArticleComment models would yield an ID of "article_comments_pagination".

Advanced options:

:param_name -- parameter name for page number in URLs (default: :page)
:params -- additional parameters when generating pagination links (eg. :controller => "foo", :action => nil)
:renderer -- class name, class or instance of a link renderer (default: Pagination::LinkRenderer)

All options not recognized by paginate will become HTML attributes on the container element for pagination links (the DIV). For example:

<% paginate @posts, :style => ‘font-size: small’ do |posts| %> … <% end %>

… will result in:

<div class=“pagination” style=“font-size: small”> … </div>

No changes in controllers.