ActiveAdmin actions

Do this way,

ActiveAdmin.register Foobar do
  actions :all, :except => [:destroy]
end

or

ActiveAdmin.register Foobar do
  actions :only => :edit
end

Need to be specified at resource level not in method definition


Example how to play with the action column. In this example I just re-implemented the default one, but you can do powerful coding here:

column :actions do |item|
  links = []
  links << link_to('Show', item_path(item))
  links << link_to('Edit', edit_item_path(item))
  links << link_to('Delete', item_path(item), method: :delete, confirm: 'Are you sure?')
  links.join(' ').html_safe
end

Add whatever actions you want to be available by using actions (it is usually put under model definition):

ActiveAdmin.register YourModel do
actions :index, :show, :create, :edit, :update

If you want to specify the method for certain action, you can do

action_item only: :show  do
  link_to 'Edit', action: :edit # so link will only be available on show action
end