-
Notifications
You must be signed in to change notification settings - Fork 864
Installation
mislav edited this page Aug 23, 2011
·
8 revisions
To install will_paginate in Rails 3 or other frameworks:
## Gemfile for Rails 3, Sinatra, or Merb
gem 'will_paginate', '~> 3.0.0'
Then run bundle install
. It will automatically hook into Rails or Merb on application boot.
A Sinatra app needs a couple of extra requires:
## Sinatra app:
require 'will_paginate'
require 'will_paginate/active_record' # or data_mapper/sequel
For Padrino apps you need to manually register the Sinatra extension:
## app.rb
register WillPaginate::Sinatra
## boot.rb
Padrino.after_load do
require 'will_paginate/data_mapper'
DataMapper.finalize
end
will_paginate 3.0 and newer doesn't support Rails older than 3.0. If you run an older version of Rails, you have to use the 2.3.x version of will_paginate:
## Rails 2.1 - 2.3: environment.rb
Rails::Initializer.run do |config|
config.gem 'will_paginate', :version => '~> 2.3.16'
end
Then run rake gems:install
(use sudo
if necessary).
For Rails 2.0 or older, a simple require will suffice:
## Rails 1.2 - 2.0: environment.rb
require 'will_paginate'
- Installation instructions
- API documentation
- Differences between v2.3 - v3.0
- Troubleshooting or Report bugs
- Simple search functionality
- Translating output (i18n)
- Browse the source code
- See the recent commits