One of the nicest things about the Rails framework is the quality of third-party libraries available for use in your applications.
For a couple of months now, the team has been working on an internal Rails application during which we’ve had the need to introduce pagination. We ended up rolling with the will_paginate gem.
Straight from the developer:
Pagination is just limiting the number of records displayed. Why should you let it get in your way while developing, then?
Assuming you’re using Rails 3, simply add
[cc lang=”text”]
gem “will_paginate”, “~> 3.0.pre2″
[/cc]
To your Gemfile then run
[cc lang=”text”]
bundle install
[/cc]
After that, there are some minor modifications you’ll need to make to your models.
You can check it out on RubyGems and GitHub or browse the documentation here.
I’d argue that this particular gem is the standard for Rails pagination.
Speak your mind...