1
在博客应用程序中我想显示带有文章的标签列表。查找带有文章的标签
class Article < AR::B
has_and_belongs_to_many :tags
end
class Tag < AR::B
has_and_belongs_to_many :articles
end
标记范围是什么样的?
Tag.joins(:articles) ... # should return tags associated to at least 1 article
谢谢@ thomas-klemm正是我所需要的。 – olimart 2013-03-25 21:21:55
不客气:--D – 2013-03-25 21:27:20