Sha256: 10065e66fb8be6fcb4fcb65bd53208b5a6bc9c3f2e2ed007622de23a398a1ec9
Contents?: true
Size: 1.45 KB
Versions: 3
Compression:
Stored size: 1.45 KB
Contents
[](http://badge.fury.io/rb/pagers) [](https://codeclimate.com/github/museways/pagers) [](https://travis-ci.org/museways/pagers) [](https://gemnasium.com/museways/pagers) # Pagers Minimalistic pagers inspired in kaminari and will_paginate for rails. ## Install Put this line in your Gemfile: ```ruby gem 'pagers' ``` Then bundle: ``` $ bundle ``` ## Configuration Generate the configuration file: ``` rails g pagers:install ``` The defaults values are: ```ruby Pagers.configure do |config| config.length = 20 config.padding = 0 config.parameter = :page config.pages = 5 end ``` ## Usage Call the page scope from your models: ```ruby @collection = Model.page(1, length: 10, padding: 4) ``` And in your views just: ```erb <%= paginate @collection %> ``` NOTE: You can override the parameters in the scope and in the helper. ## SEO You can add the parameter to paths: ```ruby get 'search/:query/(:page)' => 'products#search' ``` To produce routes like: ``` search/sample search/sample/2 search/sample/3 . . . ``` ## 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pagers-3.1.4 | README.md |
pagers-3.1.3 | README.md |
pagers-3.1.2 | README.md |