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

The controller:

require "rango/contrib/pagination"

class Posts < Application
  before :setup_page
  protected
  def setup_page
    @page = Order.page(params[:page] || 1)
  end
end

The template:

# it will be partial "gems/gems/rango-pagination/app/rango-pagination/views", page: @page
paginate @page

Helpers

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

Strategies

- Rango::Pagination::Strategies::Default
- Rango::Pagination::Strategies::PageNumberOnTheEndOfRoute
- Rango::Pagination::Strategies::PageNumberOnTheEndOfRouteExcludeFirstPage

Pagination Template Customization

Clone this wiki locally