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...@gmail.com> wrote: > On Mon, Oct 5, 2009 at 12:42 AM, venki <venkiwh...@gmail.com> 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/ --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---