문제

how override attr_accessible role for field :name in Tag model in ActsAsTaggableOn gem ?

I want some things like that in Tag model ...

attr_accessible :name, :as => [:default, :admin]

for allow me to edit field name of tag by admin role

도움이 되었습니까?

해결책

You can monkey patch acts_as_taggable_on by creating a file in config/initializers and adding the following lines. Restart your rails server for changes to take effect.

ActsAsTaggableOn::Tag.class_eval do
  attr_accessible :name, :as => [:default, :admin]
end
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top