will_paginate-bootstrap
This gem integrates the Twitter Bootstrap pagination component with the will_paginate pagination gem.
Just like will_paginate, Rails and Sinatra are supported.
Install
gem install will_paginate-bootstrap
, or- For projects using Bundler, add
gem 'will_paginate-bootstrap'
to your Gemfile
(and then run bundle install
).
Usage
Rails
- Load the Bootstrap CSS in your template.
- In your view, use the
renderer: BootstrapPagination::Rails
option with the will_paginate
helper, for example:
<%= will_paginate @collection, renderer: BootstrapPagination::Rails %>
Sinatra
- Load the Bootstrap CSS in your template.
require "will_paginate-bootstrap"
in your Sinatra app.- In your view, use the
renderer: BootstrapPagination::Sinatra
option with the will_paginate
helper, for example:
<%= will_paginate @collection, renderer: BootstrapPagination::Sinatra %>
Compatibility
Starting at version 1.0, this gem no longer supports Bootstrap 2.
Ruby | >= 1.9.2 |
---|
will_paginate | >= 3.0.3 |
---|
Twitter Bootstrap | >= 3.0.0 |
---|
Legacy Bootstrap 2 Support
Use version 0.2.5, in your GemFile use
gem 'will_paginate-bootstrap', '0.2.5'