hartian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Mar-28 01:11 UTC
Activeresource and pagination.
Hi, I am fairly new to rails and am trying to figure out the right way to do pagination with ActiveResource. I am considering just wrapping will_paginate over everything but I before I do I was hoping to get some input from some more experienced developers. Thanks,George --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I used tha pgination feature in Rails 2.0.2. It worked fairly well. FOr that:> Include will_paginate plugin in vendor folder. > ANd write the code in the controller from where you are retrieving the table data from the datbase.e.g. @peopledata = Person.paginate(:page => params[:page], :conditions => [...])> If you want to set the number of list(e.g. 5) to be displayed per pageInclude in model..person.rb def self.per_page 5 end>In view adda line<% will_paginate @peopleData %> Pagination will start working with next and previous. Thanks Ekta On Mar 28, 6:11 am, "hart...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <hart...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am fairly new to rails and am trying to figure out the right way to > do pagination with ActiveResource. I am considering just wrapping > will_paginate over everything but I before I do I was hoping to get > some input from some more experienced developers. > > Thanks,George--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I used tha pgination feature in Rails 2.0.2. It worked fairly well. FOr that:> Include will_paginate plugin in vendor folder. > ANd write the code in the controller from where you are retrieving thetable data from the datbase. e.g. @peopledata = Person.paginate(:page => params[:page], :conditions => [...])> If you want to set the number of list(e.g. 5) to be displayed per pageInclude in model..person.rb def self.per_page 5 end>In view adda line<% will_paginate @peopleData %> Pagination will start working with next and previous. Thanks Ekta On Fri, Mar 28, 2008 at 6:41 AM, hartian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <hartian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I am fairly new to rails and am trying to figure out the right way to > do pagination with ActiveResource. I am considering just wrapping > will_paginate over everything but I before I do I was hoping to get > some input from some more experienced developers. > > Thanks,George > > > > > >-- Ekta Goel Software Engineer Mobera Systems www.moberasystems.com Chandigarh + 91-9876967932 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hartian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hi, > > I am fairly new to rails and am trying to figure out the right way to > do pagination with ActiveResource. I am considering just wrapping > will_paginate over everything but I before I do I was hoping to get > some input from some more experienced developers. > > Thanks,GeorgeI think <a href="http://github.com/c42/pox_paginate">PoxPaginate</a> is what you''re looking for. It''s based on ideas tested in production; basically on the server you do ActiveRecordKlass.paginate, and when you deserialise this on the ActiveResource end, you get a WillPaginateCollection. Cheers, Sidu. -- 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.