Custom action

John dowd edited this page Aug 19, 2015 · 7 revisions
Clone this wiki locally

Create a reusable action ActionName

rails plugin new rails_admin_<action_name> -m --skip-gemfile --skip-bundle -T -O -S -J --full

Add it to your project

# Gemfile

# if uploaded to github with a valid .gemspec (remove TODOS and change owner credentials)
gem 'rails_admin_<action_name>', :git => 'git://<username>/rails_admin_<action_name>.git'
# or in development mode
gem 'rails_admin_<action_name>', :path => '../rails_admin_<action_name>'

Development documentation

See the Base class your ActionName will inherit from:

It is also possible to inherit from any other action class.

Useful link

Here is a useful link describing how to create custom action in Rails admin, as a plugin

Here's another example, which adds a custom action without needing to add it as a plugin:

Double pjax

If you're seeing a double call to your new action, try disabling pjax.

register_instance_option :pjax? do