adding an admin flag to a user along with rails_admin
-
23-03-2021 - |
Question
I have added an admin flag to my users model following the devise wiki here (the second option):
https://github.com/plataformatec/devise/wiki/How-To%3a-Add-an-Admin-role
but not in rails_admin the admin flag is disabled, isn't it supposed to be a checkbox instead of a grey circle.
La solution
This is because rails_admin
automatically disables this field for safety reasons. To re-enable it, you can set the config.attr_accessible_role
field in config/initializers/rails_admin.rb
, like this:
config.attr_accessible_role { nil }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow