How to remove the delete option form activeAdmin?

in rails gem active admin I want to remove the delete option form the default_actions while I still need the edit and show action , is there any way to do it ?


Solution 1:

You add a call to actions to every Active Admin resource:

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

Solution 2:

At some point I had this problem, because of the destroy method, the 'Delete' button didn't disappear

actions :all, except: [:destroy]

controller do
  def destroy # => Because of this the 'Delete' button was still there
    @user = User.find_by_slug(params[:id])
    super
  end    
end