Search code examples
ruby-on-railsactiveadmin

How to add button to ActiveAdmin's index page


I created a collection action for ActiveAdmin rescource and want to link to it from the resource index page.

But how do I customize the resource index page?

The manual gives some options, but none to add html / buttons on the page (or I cannot see where).

http://activeadmin.info/docs/3-index-pages.html


Solution

  • You can create buttons on index page with action_item block:

    action_item only: :index do
      link_to 'Button text', post_path(post)
    end
    

    https://github.com/activeadmin/activeadmin/blob/master/docs/8-custom-actions.md#action-items