0
我想在我的應用程序中添加標記功能。所以,我使用acts_as_taggable_on:https://github.com/mbleigh/acts-as-taggable-onActAsTaggableOn在mongodb和rails 3中
我已經加入以下行我的Gemfile:
gem 'acts-as-taggable-on', '~> 2.2.2'
,當我在我的用戶模型中添加以下行:
acts_as_taggable_on
它給了我這個錯誤:
undefined local variable or method `acts_as_taggable_on' for User:Class
請告訴我我做錯了什麼?
謝謝,這是有用的,但我怎麼能找到所有屬於一個特定的標籤?或所有用戶屬於任何給定的標籤? 就像:User.tagged_with([「awesome」,「cool」],:any => true)在acts_as_taggable_on? – d34th4ck3r 2012-02-06 20:54:23
User.any_in(tags:[「awesome」,「cool」]) – 2012-02-06 21:33:49
你能告訴我如何寫入表單以將輸入輸入到數組中嗎? – d34th4ck3r 2012-02-07 20:47:13