© 2018 Domizio DemichelisMIT License

Bootstrap Extra

This extra adds nav helpers and templates for the Bootstrap pagination component.

Synopsis

See extras for general usage info.

In the pagy.rb initializer:

require 'pagy/extras/bootstrap'

Render the navigation links in some view… with a fast helper:

<%== pagy_bootstrap_nav(@pagy) %>
<%== pagy_bootstrap_responsive_nav(@pagy) %>
<%== pagy_bootstrap_compact_nav(@pagy) %>

or with a template:

<%== render 'pagy/bootstrap_nav', locals: {pagy: @pagy} %>

Configure javascript if you use pagy_bootstrap_responsive_nav or pagy_bootstrap_compact_nav.

Files

Methods

This extra adds 3 nav helpers to the Pagy::Frontend module. You can customize them by overriding them directly in your own view helper.

pagy_bootstrap_nav(pagy)

This method is the same as the pagy_nav/pagy_plain_nav, but customized for Bootstrap.

The bootstrap_nav.* templates produce the same output, and can be used as an easier (but slower) starting point to override it.

pagy_bootstrap_compact_nav(pagy, …)

This method is the same as the pagy_plain_compact_nav, but customized for the Bootstrap framework.

Here is an example:

pagy-compact

See more details in the compact navs documentation.

pagy_bootstrap_responsive_nav(pagy, …)

This method is the same as the pagy_plain_responsive_nav, but customized for the Bootstrap framework.

See more details in the responsive navs documentation.

Optional Template Files

See Using Templates.