Pager for lots o' data


/ Published in: Ruby
Save to your folder(s)

This function (intended to be an application or view helper) creates a pager bar useful for navigating many pages. It shows the first, last, current, nearby, and halfway-to-end pages. It looks like this (where the current page is 11):

< 1 ... 5 ... 10 11 12 ... 14 15 >

The pagerBar function takes two parameters: a RoR paginator, and an anchor that will be attached to all the links.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.