act-as-taggable-on context name是复数还是单数?

时间:2013-02-12 13:25:09

标签: ruby-on-rails acts-as-taggable-on

假设act-as-taggable-on上下文名称必须是复数是否正确? "技能" vs"技能"?文档没有明确说明命名约定。

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">]

1 个答案:

答案 0 :(得分:1)

你现在可能已经想到了这一点,但是你是对的。上下文是复数。