remcoh
#1
hi
i know i can do:
@customer_pages, @customers = paginate :customers, :per_page => 8
but these customers have helpdesk calls which are child records. I hoped
i could do something like paginate customers.calls, but dat doesn’t work
what is the best way to get a paginated list of child records?
remco
remcoh
#2
@customer_pages, @customers = paginate( :customers, :per_page =>
8, :include => :calls)
Or, you might want to switch that around:
paginate( :calls, :per_page => 8, :include => :customers)
http://api.rubyonrails.com/classes/ActionController/
Pagination.html#M000104
- dan
–
Dan K. mailto:[email protected]
http://www.dankohn.com/ tel:+1-415-233-1000
remcoh
#3
paginate :calls, :conditions = [‘customer_id = ?’, customer_id]