1

에 대한 기록이 어떻게 templateshas_and_belongs_to_many 관계를 가지고있는 current_userarticles 경우에 사용할 수있는 articles를 얻기 위해이 요청을 다시 할거야? 나는 가깝다고 느낀다. 그러나 나는 그것을 정말로 이해할 수 없다.레일 : has_and_belongs_to_many 협회

current_user.brand.articles.joins(:template).where(:templates => { :id => @template.id }) 

감사합니다.

current_user.brand.articles.joins(:templates).where(:templates => { :id => @template.id }) 

당신은에 where 절에 templates를 복수화하지만했다 : brand 협회는 추측을 나타내고 모델을 게시하는 것은이 문제를 알아내는 데 도움이 먼 길을 갈 것입니다,하지만 여기에 무엇을

답변

1

확실하지 않음 어울리다.

+0

당신은 맞았습니다. 고맙습니다! –