I am customizing Rails Admin : https://github.com/sferik/rails_admin , i need to disable/hide "Add new" option for some model.
Any help will save lot time for me. Thanks in advance
I am customizing Rails Admin : https://github.com/sferik/rails_admin , i need to disable/hide "Add new" option for some model.
Any help will save lot time for me. Thanks in advance
To have multiple models you must put each model in single quotes:
For example consider the following configuration:
This means that:
User
model you could see it in the navbar, edit it, and add a new one on the index page.I use the following to achieve this on a specific model. Hopefully, this helps:
The answer is in the configuration documentation for actions. By default, all actions are possible, including
new
. To customize the possible actions, inconfig.actions
inconfig/initilizers/rails_admin.rb
, list all the actions you want to support, leaving out the ones you don’t want to support. For example, here is a config block that allows all of the default actions except fornew
:Implemented it with Cancan. You can refer to above answer to do it in rails admin way.
URL : https://github.com/sferik/rails_admin/wiki/CanCan