Forum: Ruby on Rails Pagination attributes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris (Guest)
on 2006-03-14 01:14
I have created a pagination with my own conditions :

@timesheets_pages = Paginator.new self, count, 30, @params['page']

    @timesheets = Timesheet.find :all,:include
=>{:employee=>[:location,:division]},
                                :conditions =>  ["employees.location=?
and employees.division=? and start_date>? and end_date < ?
",@location.id,@division.id,@start_date,@end_date],
                                :order=>    "timesheets.start_date
desc",
                                :limit =>
@timesheets_pages.items_per_page,
                                :offset =>
@timesheets_pages.current.offset

Where is the best place to store the filter parameters
(@location,@division,@start_date,@end_date) of the find? Each time the
find is run it must recall the params of the find. I'm currently storing
them in the session.    What is the best way?

Thanks,
Chris
This topic is locked and can not be replied to.