Sha256: c8f4bcc728e208a64491365ca8115e9626f76b55e967c6428757d1849ab4c942

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

Stored size: 1.48 KB

Contents

{<img src="https://codeclimate.com/github/mattways/rails_pagination.png" />}[https://codeclimate.com/github/mattways/rails_pagination] {<img src="https://secure.travis-ci.org/mattways/rails_pagination.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/rails_pagination] {<img src="https://gemnasium.com/mattways/rails_pagination.png" alt="Dependency Status" />}[https://gemnasium.com/mattways/rails_pagination]

= Rails Pagination

Inspired in kaminari and will_paginate but more minimalistic

= Install

Put this line in your Gemfile:
  gem 'rails_pagination'
  
Then bundle:
  $ bundle
  
= Usage

The same approach as kaminari:
  Model.page(1).per(20)

You can use the default html with this helper:
  pager @collection

Or you can make your own just paginating the collection:
  paginate @collection # Loot at app/views/rails_pagination/_pager.html.erb

= Configuration

== Default param name

If you want to change the default parameter name or the default navigation length call pager/paginate this way:
  pager @collection, navigation: 3, parameter: :p
Or to set it globally put this in your application.rb:
  config.pagination.default_parameter = :p
  config.pagination.default_navigation = 5

== Default per page

If you want to change the default per_page put this in your model:
  default_per_page 5
Or to set it globally put this in your application.rb:
  config.pagination.default_per_page = 5

== Padding

You can use positive and negative padding:
  Model.page(1).per(10).pad(-4)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_pagination-2.0.10 README.rdoc
rails_pagination-2.0.9 README.rdoc
rails_pagination-2.0.8 README.rdoc
rails_pagination-2.0.7 README.rdoc