0
나는 예에 의해, 그래서 A는 has_many :through
협회 그래서 집 등has_many : URL /보기의 연결을 통해?
나는 사용자 지정 쿼리를했다 "풀 하우스" "lastminute"등의 다중 카테고리를 가질 수 있습니다, 내 주택 모델 (테이블 조인) 추가 I 콘솔에서 "lastminute"카테고리 (5)
@lastminutes = House.find(:all, :select=>"houses.*", :joins=>"JOIN category_join_tables ON houses.id = category_join_tables.house_id", :conditions=>["category_join_tables.house_id = houses.id AND category_join_tables.category_id = ?", 5])
이 잘 작동의 모든 집을 원한다.
내 사이트에서이 기능을 작동시키는 가장 좋은 방법은 무엇입니까? 나는 URL stucture가 다음을 원한다 :
domain.com/locale/holidayhouses/lastminutes (house in the lastminute category)
domain.com/locale/holidayhouses/holidayhouses_with_pool (houses in the pool category)
domain.com/locale/lastminutes (houses and appartments in the lastminute category)
도움이 될 것입니다!