Module Kaminari::Helpers::SinatraHelpers::HelperMethods
In: lib/kaminari/helpers/sinatra_helpers.rb

Methods

Public Instance methods

A simple "Twitter like" pagination link that creates a link to the next page. Works on Sinatra.

Examples

Basic usage:

  <%= link_to_next_page @items, 'Next Page' %>

Ajax:

  <%= link_to_next_page @items, 'Next Page', :remote => true %>

By default, it renders nothing if there are no more results on the next page. You can customize this output by passing a parameter :placeholder.

  <%= link_to_next_page @items, 'Next Page', :placeholder => %{<span>No More Pages</span>} %>

A simple "Twitter like" pagination link that creates a link to the previous page. Works on Sinatra.

Examples

Basic usage:

  <%= link_to_previous_page @items, 'Previous Page' %>

Ajax:

  <%= link_to_previous_page @items, 'Previous Page', :remote => true %>

By default, it renders nothing if there are no more results on the previous page. You can customize this output by passing a parameter :placeholder.

  <%= link_to_previous_page @users, 'Previous Page', :placeholder => %{<span>At the Beginning</span>} %>

A helper that renders the pagination links - for Sinatra.

  <%= paginate @articles %>

Options

  • :window - The "inner window" size (4 by default).
  • :outer_window - The "outer window" size (0 by default).
  • :left - The "left outer window" size (0 by default).
  • :right - The "right outer window" size (0 by default).
  • :params - url_for parameters for the links (:id, :locale, etc.)
  • :param_name - parameter name for page number in the links (:page by default)
  • :remote - Ajax? (false by default)
  • :ANY_OTHER_VALUES - Any other hash key & values would be directly passed into each tag as :locals value.

[Validate]