Sha256: 5d271bb5eaa23f7b8846f3ae515c450a3e573b3157cb1e21ad07496f596fe2c1

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

{<img src="https://badge.fury.io/rb/pagers.png" alt="Gem Version" />}[http://badge.fury.io/rb/pagers] {<img src="https://codeclimate.com/github/museways/pagers.png" />}[https://codeclimate.com/github/museways/pagers] {<img src="https://travis-ci.org/museways/pagers.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/pagers]

= Pagers

Minimalistic pagers inspired in kaminari and will_paginate for rails.

= Install

Put this line in your Gemfile:
  gem 'pagers'

Then bundle:
  $ bundle

= Usage

Call the page scope from your models:
  @collection = Model.page(1, length: 10, padding: 4)

And in your views just:
  <%= paginate @collection %>

You can customize the parameter and the pages if you like:
  <%= paginate @collection, parameter: :p, pages: 3 %>

= Configuration

All the defaults can be customized globally in your application.rb:
  config.pagers.parameter = :p
  config.pagers.pages = 3
  config.pagers.length = 5
  config.pagers.padding = 0

= Credits

This gem is maintained and funded by museways[http://museways.com].

= License

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pagers-3.0.3 README.rdoc