Hi, I am creating a little blogging engine, so I want the most recent posts to display first, so I make a search with :order => ''created_at DESC'' For some reason, will_paginate works the opposite way I expect it to be. I mean the previous / next links are opposite to what I want. What could I be doing wrong? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Dec-27 23:24 UTC
Re: will_paginate working in the opposite way expected
On 27 Dec 2008, at 18:38, Fernando Perez wrote:> > Hi, > > I am creating a little blogging engine, so I want the most recent > posts > to display first, so I make a search with :order => ''created_at DESC'' > > For some reason, will_paginate works the opposite way I expect it to > be. > I mean the previous / next links are opposite to what I want. What > could > I be doing wrong?As in Next fetches older posts ? If so you''re not doing anything wrong. While you may thing of next as more recents posts, will_paginate only cares about it being the next page. You can tell will_paginate what labels to use for the links with the :next_label/:previous_label options so you can swap them around or use something less ambiguous like older/newer Fred> > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2008-Dec-29 17:36 UTC
Re: will_paginate working in the opposite way expected
Frederick Cheung wrote:> On 27 Dec 2008, at 18:38, Fernando Perez wrote: > >> could >> I be doing wrong? > > As in Next fetches older posts ? If so you''re not doing anything > wrong. While you may thing of next as more recents posts, > will_paginate only cares about it being the next page. > You can tell will_paginate what labels to use for the links with > the :next_label/:previous_label options so you can swap them around or > use something less ambiguous like older/newer > > FredOk I get it Frederick, so everything is working fine, it''s just the name that mixed me up. Thanks. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---