Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Pagination

botanicus edited this page Sep 13, 2010 · 10 revisions

This page is up to date for Rango 0.1.

Introduction

Pagination plugin supports just DataMapper so far, but more ORMs will be supported soon.

Example

Controller

Template

Helpers

- paginate(page = Page.current)
- previous_page(text, page = Page.current)
- next_page(text, page = Page.current)

Strategies

- Rango::Pagination::Strategies::Default (default, URLs will looks like ?page=#{pagenum})
- Rango::Pagination::Strategies::PageNumberOnTheEndOfRoute (URLs like /products/5)
- Rango::Pagination::Strategies::PageNumberOnTheEndOfRouteExcludeFirstPage (URLs like /products/5, but first page will have just /products)

Pagination Template Customization

Also the Page class has some useful methods like Page#first?, see the documentation