When pagination disappears what to do?

Hi,

I have read in the past that pagination will move from Rails core to a
plugin with Rails 2.0. It seems like some of the core developers (eg.
DHH, Molena) now think pagination is poor design. What do they suggest
as an alternative. Does anyone have a link to a blog title something
like “life after pagination”? I’m not quite sure how an email
application would work without pagination.

Thanks,
Peter

JavaScript for Rails: http://forkjavascript.org

On 30 Dec 2006, at 16:47, Peter M. wrote:

I have read in the past that pagination will move from Rails core to a
plugin with Rails 2.0. It seems like some of the core developers (eg.
DHH, Molena) now think pagination is poor design. What do they suggest
as an alternative. Does anyone have a link to a blog title something
like “life after pagination”? I’m not quite sure how an email
application would work without pagination.

There are two objections to pagination:

  • the concept is unhelpful because, as usually implemented, numbered
    pages have no semantic meaning to help you navigate. E.g. Google’s
    list of pages of search results – what’s the difference between page
    9 and page 10?

  • the implementation in Rails is suboptimal

The first objection can be addressed by using meaningful page
navigation. E.g. for a list of people, make the paging links
alphabetical rather than numerical.

A number of people have written their own pagination plugins to
address the second objection. For example:

http://cardboardrocket.com/pages/paginating_find

Regards,
Andy S.

Hey Peter-

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.

http://paginator.rubyforge.org/

Cheers-
– Ezra Z.
– Lead Rails Evangelist
[email protected]
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)

Without commenting on the implementation of Rails pagination, I find
the idea that page numbering is of little semantic value a poor
reason to deprecate the feature. Surely, “next” and “previous” have
semantic value. In any list-like application, one will either have to
display all the records on one page or use some pagination. I’ve read
about the Ajax replacement for pagination, and while nice, it may
have usability issues.

I felt that some basic level of authentication was among the “common
case” scenarios for Web apps, but it was deemed “better left for a
plugin.” Now we have zillions of authorization and authentication
plugins and no clear winner. I feel we’d have the same issue with
pagination if some basic level of support were not present in Rails.

Consider this a plea to keep pagination (I know I won’t convince
anyone about authentication :).

Steve

Hi Andy,

On 12/30/06, Andrew S. [email protected] wrote:

On 30 Dec 2006, at 16:47, Peter M. wrote:

There are two objections to pagination:

  • the concept is unhelpful because, as usually implemented, numbered
    pages have no semantic meaning to help you navigate. E.g. Google’s
    list of pages of search results – what’s the difference between page
    9 and page 10?

Interesting. is this really the main objective to pagination? In the
case of google the the search rank decreases with increasing page
number. In the case of email the email age increases with increasing
page number. These seem quite natural to me and I’m interested if this
is the real objection to pagination because people don’t seem to have
a problem understanding what the page numbers mean in google or email
apps.

  • the implementation in Rails is suboptimal

The first objection can be addressed by using meaningful page
navigation. E.g. for a list of people, make the paging links
alphabetical rather than numerical.

A number of people have written their own pagination plugins to
address the second objection. For example:

http://cardboardrocket.com/pages/paginating_find

Thanks for the link, I’ll check it out.

Peter

JavaScript for Rails: http://forkjavascript.org

Ezra Z. wrote:

Hey Peter-

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.

http://paginator.rubyforge.org/
.
.
.

I posted some example code at the Google G. Ruby on Rails: Talk
forum, which I now see mirrors this one. (
http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/7267090150ef6cc7?hl=en)

I can’t see a way to post the files here, but this here’s what I posted
(2 posts)

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.

And:

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
quickly.

It works, and uses plain old html, no javascript. I can’t say it’s
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.

Ron

Okay, I finally found a way to post this topic: check
http://wiki.rubyonrails.com/rails/pages/HowToPaginateSearches

Ok, I posted a tutorial at
http://wiki.rubyonrails.com/rails/pages/HowToPaginateSearches That’s
working for me.

Ron

To be fair, the paginator gem really only does a subset of what the
paginating_find aspires to be. In fact, I’ve been considering using
Bruce William’s paginator in place of my own paging enumerator (http://
svn.cardboardrocket.com/paginating_find/lib/paging_enumerator.rb).

The paginating_find plugin automatically counts the total number of
records based on the specified find options, supports paging has_may
associations, and even supports paging with_scope. Recently, I also
committed helpers for pagination links courtesy of Ben Curtis (thanks
again, Ben). If you use the paginator gem instead of paginating_find,
you’re left up to your own devices to implement these extra features
on your own.

Either way, it’s just a matter of selecting the tool that works best
for you.

-Alex

P.S. Thanks for all your great work on merb, Ezra. =)

[email protected] wrote:

To be fair, the paginator gem really only does a subset of what the
paginating_find aspires to be. In fact, I’ve been considering using
Bruce William’s paginator in place of my own paging enumerator (http://
svn.cardboardrocket.com/paginating_find/lib/paging_enumerator.rb).

The paginating_find plugin automatically counts the total number of
records based on the specified find options, supports paging has_may
associations, and even supports paging with_scope. Recently, I also
committed helpers for pagination links courtesy of Ben Curtis (thanks
again, Ben). If you use the paginator gem instead of paginating_find,
you’re left up to your own devices to implement these extra features
on your own.

Either way, it’s just a matter of selecting the tool that works best
for you.

-Alex

P.S. Thanks for all your great work on merb, Ezra. =)

You’re right, Alex – one reason I chose the paginator gem was that it
didn’t “duplicate” all those other Rails functions. It made a simpler
tutorial: just get your search results by whatever means, and let
paginator do the splitting up.

It’s nice to have options!

Ron

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs