假设 act-as-taggable-on 上下文名称必须是复数是否正确?“技能”与“技能”?该文档没有明确说明命名约定。
class User < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :*skills*, :interests
end
@user = User.new(:name => "Bobby")
@user.tag_list = "awesome, slick, hefty"
@user.skill_list = "joking, clowning, boxing"
@user.tags # => [<Tag name:"awesome">,<Tag name:"slick">,<Tag name:"hefty">]
@user.skills # => [<Tag name:"joking">,<Tag name:"clowning">,<Tag name:"boxing">]