Class Ramaze::Helper::Paginate::Paginator
In: lib/ramaze/helper/paginate.rb
Parent: Object

Provides easy pagination and navigation

Methods

Included Modules

Ramaze::Helper

Classes and Modules

Class Ramaze::Helper::Paginate::Paginator::ArrayPager
Class Ramaze::Helper::Paginate::Paginator::DataMapperPager

Public Class methods

Public Instance methods

Returns String with navigation div.

This cannot be customized very nicely, but you can style it easily with CSS.

Output with 5 elements, page 1, limit 3:

    <div class="pager">
      <span class="first grey">&lt;&lt;</span>
      <span class="previous grey">&lt;</span>
      <a class="current" href="/index?pager=1">1</a>
      <a href="/index?pager=2">2</a>
      <a class="next" href="/index?pager=2">&gt;</a>
      <a class="last" href="/index?pager=2">&gt;&gt;</a>
    </div>

Output with 5 elements, page 2, limit 3:

    <div class="pager" />
      <a class="first" href="/index?user_page=1">&lt;&lt;</a>
      <a class="previous" href="/index?user_page=1">&lt;</a>
      <a href="/index?user_page=1">1</a>
      <a class="current" href="/index?user_page=2">2</a>
      <span class="next grey">&gt;</span>
      <span class="last grey">&gt;&gt;</span>
    </div>

Useful to omit pager if it‘s of no use.

these methods are actually on the pager, but we def them here for convenience (method_missing in helper is evil and even slower)

[Validate]