Skip to content
Ronald Chan edited this page Mar 17, 2012 · 9 revisions

To install this gem, add the following line to your Gemfile:

gem 'ajax_pagination'

Then run

bundle install

Add the following lines to your manifests:

// app/assets/javascripts/application.js
//= require ajax_pagination
/* app/assets/stylesheets/application.css
 *= require ajax_pagination
 */

Note that javascript dependencies will be automatically included by sprockets (if not already required by the application manifest). These are jquery, jquery_ujs, history.js, jquery.url, jquery.ba-bbq.

An initializer is not necessary, but can be used to change the configuration if the defaults are not suitable. To create an initializer file, simply run:

bundle exec rails generate ajax_pagination:install

You new initializer can be found at /config/initializers/ajax_pagination.rb.