-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Custom action
Olle Jonsson edited this page Jul 17, 2019
·
11 revisions
rails plugin new rails_admin_<action_name> -m https://gist.github.com/bbenezech/1621146/raw/5268788e715397bf476c83d76d335f152095e659/rails_admin_action_creator --skip-gemfile --skip-bundle -T -O -S -J --full
# Gemfile
# if uploaded to github with a valid .gemspec (remove TODOS and change owner credentials)
gem 'rails_admin_<action_name>', :git => 'git://github.com/<username>/rails_admin_<action_name>.git'
# or in development mode
gem 'rails_admin_<action_name>', :path => '../rails_admin_<action_name>'
See the Base class your ActionName
will inherit from:
https://github.com/sferik/rails_admin/blob/master/lib/rails_admin/config/actions/base.rb
It is also possible to inherit from any other action class.
How to create custom action in Rails admin, as a plugin:
http://blog.endpoint.com/2012/03/railsadmin-custom-action-case-study.html
Add a custom action without needing to add it as a plugin:
Create a custom action:
https://blog.codeminer42.com/writing-custom-railsadmin-actions-e0799aadc8ae
If you're seeing a double call to your new action, try disabling pjax.
register_instance_option :pjax? do
false
end