Pergunta

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

Foi útil?

Solução

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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top