ruby on rails
In my Rails app, Users have many projects , and projects have many spins.
I'm using the acts-as-taggable-on gem to enable users to add tags to their spins.
I'm building a feature so I can list all the tags used by a particular user and enable users to filter their projects based on these tags.
According to the documentation, I can add ownership to tags. But I'm unsure how to apply their example of
User.find(:first).posts.tag_counts_on(:tags)
to my own application. My best guess is
User.first.projects.join(:spins).tag_count_on("spin.tags")
But I get an error TypeError: no implicit conversion of Symbol into String
Anyone able to help?
链接地址: http://www.djcxy.com/p/35948.html上一篇: ActiveRecord :: Base#find在单表继承(STI)中返回没有记录
下一篇: 红宝石在轨道上