Forum: Ruby on Rails Search by foreign key of foreign key

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.
Aeeb115b5d26ee5e0568128f8fd3bc80?d=identicon&s=25 Andrew (Guest)
on 2007-04-19 02:37
Hi,

So far I can sort by foreign key.


 @section_pages, @sections = paginate :sections, :per_page => 20, :order
=> sort, :include => :title


But how do I sort by a foreign key of the foreign key.

I have "sections" which belong to "courses" which belong to "subjects".

I want to sort by "prefixes" which is in "subjects".

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