2

假设 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">]
4

1 回答 1

1

您现在可能已经想通了,但是是的,您是对的。上下文是复数。

于 2013-03-18T16:12:28.460 回答