Ezra Z. wrote:
AFAIK the main objection to the current paginator was that it is
inefficient and poorly implemented. Someone already linked to the
paginating_find plugin but I personally like Bruce William’s
paginator. Its available as a gem and I have vendor’ed it in merb.
I posted some example code at the Google G. Ruby on Rails: Talk
forum, which I now see mirrors this one. (
I can’t see a way to post the files here, but this here’s what I posted
I wanted to do semantically-meaningful pagination, using Bruce William’s
paginator gem. It had to paginate results from Nate McNamara’s
search.rb. The resulting page had to let users browse multiple pages of
results without losing their search or their minds.
I refactored the code to move the docs and labels arrays into session
scope, so that they’re only invoked once per search. Now the initial
search may take a while, but the navigation of the pages goes pretty
inspiring in a graphical sense, but it does what I want. It uses the
‘title’ attribute of the submit button to give users the semantic
content of the first record on a page as a tooltip. I find I can
navigate through a 2000-hit search result and get to the record I want
in 3-4 clicks.
If anyone wants to use it or critique it, great.