Forum: Ruby on Rails Pagination on arrays

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eb6042d3fdf039e9259b1a5f17db337c?d=identicon&s=25 The Ultimation (pimeamark)
on 2008-12-11 18:25
I'm looking for a way to paginate an array of data basically. I know
about will_paginate but from what I've seen that only works on
activerecord searches. I can't seem to find a good resource that lets
you paginate a regular data set. Anyone got a tip on this? I'd really
appreciate it :)
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-12-11 19:09
(Received via mailing list)
will_paginate does work on arrays. You need to create an instance of
WillPaginate::Collection targetting your array. I think there's an
example in the dogs

Sent from my iPhone

On 11 Dec 2008, at 17:25, Mark Mr <rails-mailing-list@andreas-s.net>
16b26104470ae1b64958f3caa836c193?d=identicon&s=25 Danny Burkes (dburkes)
on 2008-12-11 23:42
> I think there's an example in the dogs
>
> Sent from my iPhone
>

LOVE that iPhone spell checker
Eb6042d3fdf039e9259b1a5f17db337c?d=identicon&s=25 The Ultimation (pimeamark)
on 2008-12-12 16:31
lol well his spell-checked wouldn't have picked up "dogs" obviously. I
couldn't  find an example in the help docs but I figured out how to do
it, which was actually really easy.

@x.paginate(:per_page => 10)

:D
This topic is locked and can not be replied to.