Sha256: 6ddb8aa9469cd1c301e4b64beea1eb5e5b0cbd8dff59d63c7e0707c5cf35f594
Contents?: true
Size: 1.26 KB
Versions: 1
Compression:
Stored size: 1.26 KB
Contents
{<img src="https://codeclimate.com/github/mattways/pageable.png" />}[https://codeclimate.com/github/mattways/pageable] {<img src="https://secure.travis-ci.org/mattways/pageable.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/pageable] {<img src="https://gemnasium.com/mattways/pageable.png" alt="Dependency Status" />}[https://gemnasium.com/mattways/pageable] = Pageable Inspired in kaminari and will_paginate but more minimalistic. = Install Put this line in your Gemfile: gem 'pageable' Then bundle: $ bundle = Usage The same approach as kaminari: @records = Model.page(1).per(20) And then just: pager @records = Configuration == Default parameter and navigation If you want to change the default parameter name or the default navigation length call pager: pager @records, navigation: 3, parameter: :p Or to set it globally put this in your application.rb: config.pagination.default_parameter = :p config.pagination.default_navigation = 3 == 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).padding(-4)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pageable-2.1.0 | README.rdoc |