© 2018 Domizio DemichelisMIT License

Bootstrap Extra

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

Synopsys

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_nav_bootstrap(@pagy) %>
<%== pagy_nav_responsive_bootstrap(@pagy) %>
<%== pagy_nav_compact_bootstrap(@pagy) %>

or with a template:

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

Configure javascript if you use pagy_nav_responsive_bootstrap or pagy_nav_compact_bootstrap.

Files

This extra is composed of 4 files:

Methods

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

pagy_nav_bootstrap(pagy)

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

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

pagy_nav_compact_bootstrap(pagy, …)

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

Here is an example:

pagy-compact

See more details in the compact navs documentation.

pagy_nav_responsive_bootstrap(pagy, …)

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

See more details in the responsive navs documentation.

Optional Template Files

See Using Templates.