ressister
2008-Jun-17 18:24 UTC
paginating_find - selecting 20+ records grouped by date without breaking the day across multiple pages...
Hi there, I''m using the paginating_find plugin for one of my more popular apps. I''ve gotten a few requests from users asking not to break records associated with a given date across multiple pages. Right now, I specify the size of a record set as part of the find i.e. 20 records (see below). That generally will allow for 2 or 3 days of records, cutting the 4th day, as an example, across two pages. I need that to be more flexible to return a minimum of 20 records, but to grab all records for a given day if 20 records is going to cut any day across multiple pages. Not sure how to structure that though? Below is an example of the paginating find I''m currently using: @diary = Entries.find(:all, :conditions => ["user_id = ? and created_at LIKE ?",@diary_owner.id, params[:date] + ''%''], :page => {:size => 20, :current => params[:page], :first => 1}, :order => ''created_at desc'') Has anyone else had to solve this same problem either with paginating_find or without? I look forward to your suggestions. Thanks! -A --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---