Forum: Ruby on Rails How to paginate a table using a relation with other table

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.
Mike (Guest)
on 2007-03-27 23:40
(Received via mailing list)
Hello,

   I have this model

   Item
     has_many :tasks

   Task
     belongs_to :item


    I have a filter

   @task_pages, @tasks =paginate :tasks, :per_page => 10, :conditions
=> ["company_id = ?', company_id]

    How can I use a set of Items to return some records in Tasks, and
use it in Paginate?

     Item.find (:all, :conditions => ['model = ?','KJ-393'])

     and paginate just the tasks thar belongs to this Items?



Thank you
This topic is locked and can not be replied to.