Hello everybody, I''m working with will_paginate and i want to know how to paginate two portlet in the same view. Because the work just like this: When i click in the next page in one portlet, it goes to the next page but in the other portlet it also goes to the next changes. Can anyone help me? Thanks. -- 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.
If you provide the :param_name option to the will_paginate helper method then you can page the two separately by providing separate page params. If you do this, you will need to maintain the previous page number in a session variable or cookie so you don''t loose the page on the other list. You may also want to consider using ajax to page them individually without refreshing the whole page. http://github.com/mislav/will_paginate/wiki/ajax-pagination <http://github.com/mislav/will_paginate/wiki/ajax-pagination> On Fri, Oct 22, 2010 at 5:32 AM, h0bit <jsantana.gcc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello everybody, > > I''m working with will_paginate and i want to know how to paginate two > portlet in the same view. Because the work just like this: When i > click in the next page in one portlet, it goes to the next page but in > the other portlet it also goes to the next changes. > > Can anyone help me? > > Thanks. > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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.
On Fri, Oct 22, 2010 at 9:10 AM, Anthony Crumley <anthony.crumley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> If you provide the :param_name option to the will_paginate helper method > then you can page the two separately by providing separate page params. If > you do this, you will need to maintain the previous page number in a session > variable or cookie so you don''t loose the page on the other list. >i dont think this is enough since the will_paginate helper will generate links like this <div class="pagination"> <span class="disabled prev_page">previous</span> <span class="current">1</span> <a href="/articles?page=2" rel="next">2</a> <a href="/articles?page=3">3</a> <a href="/articles?page=4">4</a> <a href="/articles?page=2" class="next_page" rel="next">Siguiente</a> </div> you have to use js to unobtrusively create the proper <a href="/articles?page_articles=2" rel="next"> and <a href="/news?page_news=5" rel="next">, otherwise the links will always pass the same param: page for any collection, and if that happens how will you figure out what page is changing? -- 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.