1
記錄我將如何改寫這個要求,可獲取articles
到current_user
如果articles
和templates
有has_and_belongs_to_many
關係?我覺得我很接近,但我無法弄清楚。的Rails:獲得has_and_belongs_to_many協會
current_user.brand.articles.joins(:template).where(:templates => { :id => @template.id })
感謝您的幫助!
你猜對了。謝謝! –