I am a Sr. Software Developer at Oracle Cloud. The opinions expressed here are my own and not necessarily those of my employer.
RailsAdmin custom actions
RailsAdmin is a great gem and it can be extended via custom actions. But the documentation is slightly incomplete so I wanted to share my experience using it over the last couple of years. Using these custom actions we were able to significantly extend our internal admin UI. The look & feel is not as important as ability to quickly enable basic editing functionality.
Create lib/rails_admin/custom_actions.rb
Modify rails_admin.rb initializer to load the file and actions
Modify en.yml file
Create custom pages
All you have to do is in app/views/rails_admin/main create files such as root.html.haml and collection.html.haml (named after your custom actions). They will load when you click appropriate links.
These pages can be used to display high level reports or upload data into the system (just put a form_tag pointing to appropriate controller endpoint). Think of them as regular Rails pages but the controller code is in the custom_actions.rb.
Useful links
- http://stackoverflow.com/questions/11525459/customize-rails-admin-delete-action-for-a-specific-model
- http://blog.endpoint.com/2014/02/long-term-benefits-from-railsadmin.html
- https://github.com/sferik/rails_admin/blob/master/lib/rails_admin/config/actions/base.rb
- http://www.slideshare.net/benoitbenezech/rails-admin-overbest-practices