두 모델 : Course 및 ScheduledCourse가 있다고 가정 해 봅니다.레일스 3. 관련 모델별로 정렬
코스 모델에는 이름 속성이 있습니다.
코스 has_many : 계획 과정 scheduled_courses : belongs_to 물론
courses
id | name
1 | biology
2 | history
3 | chemistry
4 | literature
scheduled_courses
id | course_id
1 | 2
2 | 4
3 | 1
4 | 2
내가 액티브 쿼리 순으로 예약 된 과정을 정렬 할 수 있습니까? 문제가 해결되지 않으면
다음을 시도해보십시오. http://stackoverflow.com/questions/1530131/rails-order-using-a-has-many-belongs-to-relationship – luacassus
시도한 것을 게시해야합니다. – EricM