Let''s say you search for "dengue fever." Your search returns 137 pages, ordered by date, but labeled with a page number. You decide to look at articles written just before and after the Haitian earthquake (Jan 12, 2010). Should you start on page 65, or 125? That''s nuts.You should have the choice of 137 pages with the date of the first post on the page displayed as the page link. Start on page "Jan 7, 2010" and read forward. That''s easy. Jakob Nielsen agrees with me, so there! http://rooh.it/PageNumbersMeaningless I can do that with Bruce William''s Paginator gem (http:// groups.google.com/group/rubyonrails-talk/browse_frm/thread/ 7267090150ef6cc7/5c75c93d0324f356). However, will_paginate is the de facto standard. How do we get semantically-meaningful page links using will_paginate? Or should I stick with the paginator gem? Ron -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-May-26 15:05 UTC
Re: Can I get meaningful page links using will_paginate?
On May 26, 2:46 pm, RonPhillips <rphill...-9+Xt05h8050e0BZhvJFe1KxOck334EZe@public.gmane.org> wrote:> > > I can do that with Bruce William''s Paginator gem (http:// > groups.google.com/group/rubyonrails-talk/browse_frm/thread/ > 7267090150ef6cc7/5c75c93d0324f356). However, will_paginate is the de > facto standard. > > How do we get semantically-meaningful page links using will_paginate? > Or should I stick with the paginator gem?You can supply a custom LinkRenderer class to will_paginate, which controls how page links are displayed. You might need to do some messing around in order to get the data for each page link - i think the link renderer is given the will paginate collection object and the fact that this is the link for page 23. Does it matter that if there were suddenly a lot of articles about a given subject that you''d then have several page links all with the same title ? Fred> > Ron-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-May-26 16:12 UTC
Re: Can I get meaningful page links using will_paginate?
RonPhillips wrote:> That''s nuts.You should have the choice of 137 pages with the date of > the first post on the page displayed as the page link. Start on page > "Jan 7, 2010" and read forward. That''s easy. Jakob Nielsen agrees with > me, so there! http://rooh.it/PageNumbersMeaninglessWhat I think is even more nuts is to have to slog through 137 pages of results without having a decent way to filer that down to just a few pages at most. For example. I very rarely make it past about page 3 or 4 of a Google search result set. I''d never make it to page 125. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
RonPhillips
2010-May-27 11:16 UTC
Re: Can I get meaningful page links using will_paginate?
Ok, I am thinking search by title, then the results are sorted by date, so I want to label pages by date. There''s a series of screenshots at http://www.flickr.com/photos/21409535@N08/ to show what I mean. If I expect lots of search results in a field to be identical, then I like to index by some other logical ordering. If that''s not possible, then "title" must be the only identifier that is human-readable. In that case, how does the user decide which one he wants even after he searches? Ron On May 26, 11:05 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You can supply a custom LinkRenderer class to will_paginate, which > controls how page links are displayed. You might need to do some > messing around in order to get the data for each page link - i think > the link renderer is given the will paginate collection object and the > fact that this is the link for page 23. Does it matter that if there > were suddenly a lot of articles about a given subject that you''d then > have several page links all with the same title ? > > Fred > > Ron-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
RonPhillips
2010-May-27 11:22 UTC
Re: Can I get meaningful page links using will_paginate?
Exactly! If you search for some term, and then specify an ordering of the results, the pages should be labeled with your ordering, not numbers. Let''s say you search for "dengue fever" and then order by author. The page links should show the name of the author of the first article on the page. Then it''s easy to home in on Robert Abernathy, followed by Robert Walker, then Frederick Cheung. Why make us guess that "Walker" is going to be around 125, then click from page to page? Just label the pages with the sorting field. Ron On May 26, 12:12 pm, Robert Walker <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> RonPhillips wrote: > > That''s nuts.You should have the choice of 137 pages with the date of > > the first post on the page displayed as the page link. Start on page > > "Jan 7, 2010" and read forward. That''s easy. Jakob Nielsen agrees with > > me, so there!http://rooh.it/PageNumbersMeaningless > > What I think is even more nuts is to have to slog through 137 pages of > results without having a decent way to filer that down to just a few > pages at most. > > For example. I very rarely make it past about page 3 or 4 of a Google > search result set. I''d never make it to page 125. > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ron Phillips
2010-May-27 12:02 UTC
Re: Can I get meaningful page links using will_paginate?
RobertWalker wrote: What I think is even more nuts is to have to slog through 137 pages of results without having a decent way to filer that down to just a few pages at most. For example. I very rarely make it past about page 3 or 4 of a Google search result set. I''d never make it to page 125. RonPhillips wrote:> Exactly! If you search for some term, and then specify an ordering of > the results, the pages should be labeled with your ordering, not > numbers. > > Let''s say you search for "dengue fever" and then order by author. The > page links should show the name of the author of the first article on > the page. Then it''s easy to home in on Robert Abernathy, followed by > Robert Walker, then Frederick Cheung. Why make us guess that "Walker" > is going to be around 125, then click from page to page? Just label > the pages with the sorting field. > > Ron-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ron Phillips
2010-May-27 12:07 UTC
Re: Can I get meaningful page links using will_paginate?
RonPhillips wrote:> Ok, I am thinking search by title, then the results are sorted by > date, so I want to label pages by date. > There''s a series of screenshots at > http://www.flickr.com/photos/21409535@N08/ > to show what I mean. > > If I expect lots of search results in a field to be identical, then I > like to index by some other logical ordering. If that''s not possible, > then "title" must be the only identifier that is human-readable. In > that case, how does the user decide which one he wants even after he > searches? > > RonSorry for the crazy posting. I''d just never realized that the Google Group is actually a reflection of this forum (I mostly lurk.) Anyway, the flickr screenshots will show what I mean, I hope. How does one do that with will_paginate? Ron -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ron Phillips
2010-May-27 18:56 UTC
Re: Can I get meaningful page links using will_paginate?
Well, I still think it''s silly to make users play "guess the page number," so here''s how you can make nicely labeled page links with Paginator. In your controller: http://pastie.org/980498 and in your view: http://pastie.org/980519 Perhaps this isn''t so easy using will_paginate. So, another question: Is there any disadvantage to using Paginator? Ron -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.