Skip to content

systemu-net/will_paginate_bootstrp

Repository files navigation

will_paginate_bootstrp

Maintainability

Bootstrap Pagination Component

This gem integrates the Twitter Bootstrap pagination component with the will_paginate pagination gem.

Installation

Add to your Gemfile:

gem 'will_paginate_bootstrp'

Usage

<%= will_paginate @collection %>

The following options are available (in addition to the options available in will_paginate):

:list_classes = ['pagination']   # Array of classes
:previous_label = '&larr;'       # Previous page label
:next_label = '&rarr;'           # Next page label

For example, to place the navigation section to the center of the page, use this in your view:

<%= will_paginate @collection, list_classes: %w(pagination justify-content-center) %>

Just like you would in the regular will_paginate. If you've got a need to use the default will_paginate stylings, pass an option like so:

<%= will_paginate @collection, renderer: WillPaginate::ActionView::LinkRenderer %>

This is it 🚀