#51 will_paginate (revised)
Oct 06, 2011 | 6 minutes | Plugins
Almost every Rails application needs pagination, and will_paginate is a great way to go. Here I show you how to set it up, customize the way it looks, and see how it compares with Kaminari.



I'm aware of the Kaminari + will_paginate breakage in scenarios like when using activeadmin and I'll try to do something about it.
The way you customized previous/next labels, Ryan, is now deprecated. You should customize text via your app's locale files
Is there any workaround for using will_paginate with active_admin?
Thanks for great screencast. Loving the Pro service!
One question regarding pagination. Is it possible to paginate within limited set of records. Eg. If my table contains 300 records and i only want to show the first 100 records to users and then paginate only on those 100 records?
That doesn't work. It still paginate on all the 300 recordss
Can't see Railscasts pro in rss feed :(
There is a special pro feed you need to subscribe to.
Go to http://railscasts.com/pro , click "Manage you subscription" and then click "RSS Feed" (follow the instructions there to add the feed to iTunes)
I have a question about pagination on large sets, on the order of 100 million.
Both will_paginate and Kaminari count the records to count the number of pages that are necessary, and since I am using Postgres counts are god-awful slow.
I've hacked around it with a smart partial that will create an infinite paginator if the query will return over 5000 records (this number was chosen because 5000 can be counted quickly, and I feel confident that people won't browse through 5000 records without narrowing their search).
Anyone have any thoughts?
Thank you, Ryan Bates ... beauty, even in work, speaks for itself.
I have actually viewed and coded every single episode
... yes, play+pause+type, repeat ... the ASCIIcasts really help doing this.
It kind of helps to take the 'Monday' out of Mondays.
Will there be a script or something like ASCIIcasts for the pro versions ?
This is just a thought, not a criticism, but I was wondering if it might
be possible to purchase individual pro episodes ?
I mean a pricing scheme similar to renting movies/games at one of
those redbox kiosks ... a $1 is a great price. In this area they have
really caught on at grocery stores and 7-11's ... I almost expect to
see one on my porch one day. I think a recurring payment might be
a barrier to some, especially during these troubled times ... just a thought.
Thank you again.
hello ryan,
i'm trying to paginate an array that is returned by this statement?
InstructorRegistration.where(:joins => :user, :order => 'users.last_name')
been tryin few of the options mentioned online but not sure if these are still supported in this version of the gem...
thanks in advance
with rails3
instead of
InstructorRegistration.where(:joins => :user, :order => 'users.last_name')I think you want
InstructorRegistration.joins(:user).order('users.last_name').paginateHi,
does anyone have a good solution to modify the will_paginate paging urls?
old:
.../products?page=2
new:
.../products/page/2/
I find out a easy solution. Just edit your routes.rb file like this:
But there is another problem. I got 2 different display styles (grid and list).
When I try something like this:
I get the "pretty url" plus "?display=grid" =/
First sign in through GitHub to post a comment.