Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Rails have a built-in pagination solution?

I've noticed that pagination gems like mislav-will_paginate are quite popular. Is this because Rails does not have a built-in pagination solution or because the built-in solution is not very good?

like image 677
propstop Avatar asked Jun 08 '09 21:06

propstop


People also ask

What does Will_paginate gem do?

will_paginate 3.1. 6 will_paginate provides a simple API for performing paginated queries with Active Record, DataMapper and Sequel, and includes helpers for rendering pagination links in Rails, Sinatra and Merb web apps.


2 Answers

In Rails 2.0 the pagination ability of ActionController was removed and turned into a plugin for backwards compatibility called 'classic_pagination'. However, from my searches for a pagination solution for myself the consensus seems to be that using 'classic_pagination' is not optimal.

After watching a couple of podcasts and after several recommendations I opted to try the will_paginate plugin and haven't looked back. It's fast, easy to use and well-maintained.

I believe that even V2 of Searchlogic recommends its use.

like image 122
digitalpardoe Avatar answered Oct 04 '22 08:10

digitalpardoe


If you are using Rails 3 Kaminari plugin will be very handy for pagination. Github Railscasts

like image 43
Evgenii Avatar answered Oct 04 '22 09:10

Evgenii