Skip to content
Andrea Dal Ponte edited this page Sep 18, 2013 · 11 revisions

Create a reusable action ActionName

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

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://github.com/<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:

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.

Useful link

Here some useful link describing how to create custom action in Rails admin

http://blog.endpoint.com/2012/03/railsadmin-custom-action-case-study.html

Double pjax

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

register_instance_option :pjax? do
  false
end
Clone this wiki locally