Well, you''re not going to be doing this in Ruby, since HTTP is
stateless. Since you''re using AJAX, you might as well store your
entire resultset as JS, and fetch each page from your local
collection. That said, maybe you should look at Mislav will_paginate
(http://github.com/mislav/will_paginate). Sure, you''ll hit the DB for
each page, but it''s simple to implement, it''s well tested and
it
performs reasonably well.
Cheers,
Tim
On Oct 5, 12:23 pm, Greg Donald
<gdon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> On Mon, Oct 5, 2009 at 12:42 AM, venki
<venkiwh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hi,
>
> > I working on Ruby on Rails.I using Ajax in that.While using pagination
> > in my application first time only I want to give request to Mysql Data
> > Base ,If user click second page it should not take from database. Here
> > I can use Set and get methods or different method will be there. How
> > to implement this?
>
> Ruby has attr_* for getters and setters:
>
> http://www.ruby-doc.org/core/classes/Module.html#M001678
>
> --
> Greg Donaldhttp://destiney.com/