Adding a JOIN between two tables
问题 Here is the classes I have: Model Organization has_many Students Model Student has_many Classes belongs_to Organization Model Class a field named : price belongs_to Student scope :top_expensive_classes, joins(:students).order('price DESC') Now I want to list the top 10 expensive classes At least the first problem I have is that in the params I have the organization_id to filter based on that But I write my controller like this which does NOT work because it thinks it should find organization