Hi Tushar, not very much sure but may be following line can solve your problem.
BookPhoto.find(:all, :conditions=>["id=?",params[:id]]).paginate :per_page => 3, :page => params[:page] Sandip R~ On Tue, Jun 9, 2009 at 3:16 PM, Tushar Gandhi < [email protected]> wrote: > > Hi, > I am using "will_paginate" for pagination. For that I have written > following code. > > @selected_photos=BookPhoto.find(:all, :conditions=>["id=?", > params[:id]]) > @book_phot...@selected_photos.paginate :per_page => 3, :page => > params[:page] > > It is working fine. > I have problem with this that every time it is retrieving all records > satisfying the where condition. > I don't want like that. It should fetch only three records from the > database. > How should I do that? > > Any help will be appreciated. > > Thanks, > Tushar. > -- > Posted via http://www.ruby-forum.com/. > > > > -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

