Topic: Record Pagination


I've been reading around and it would seem most would suggest to write your own pagination procedure rather than use the built in paginator. Is this a good idea?

I'm used to writing pagination procedures in PHP and other languages so I know how it all works. I've just no idea on how (and where in my application) I would implement my own, re-usable pagination methods. Could someone give me any ideas on this?

Any help appreciated,


Re: Record Pagination

The built in pagination helper methods are a little inflexible and inefficient, this is why some people choose to write their own. I suggest you try out the built in pagination methods first because it is the simplest thing that could work and you don't really have anything to lose. If they don't seem flexible enough for you, try using the Paginator class directly, if that still doesn't give you enough control, write your own.

If you want to write your own, I would start by hard-coding everything into the existing classes then, after you get that working, extract it into its own class/helper methods.

Last edited by ryanb (2006-09-02 11:56:53)

Railscasts - Free Ruby on Rails Screencasts