Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8679117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:53:27+00:00 2026-06-12T20:53:27+00:00

I am using Rails 3.2.8 with ActiveAdmin 0.4.4 . If the :destroy action is

  • 0

I am using Rails 3.2.8 with ActiveAdmin 0.4.4 .

If the :destroy action is enabled in an ActiveAdmin resource controller, by default, the Delete <resource> button appears at the top-right of the resource show page.

That delete button is a little too prominent and too easily clickable for my liking. I admit that there is a confirmation dialog when the button is clicked, but I would still like to re-locate the button and put it elsewhere. I would probably also make it just a small link and not style it as a button.

How would I go about doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:53:28+00:00Added an answer on June 12, 2026 at 8:53 pm

    The delete action item is added in the add_default_action_items at path/to/activeadmin_gem/lib/active_admin/resource/action_items.rb in

    module ActiveAdmin
      class Resource
        module ActionItems
        ...
        def add_default_action_items
           ...
        end
      end
    end
    

    So what you could do is just wipe the delete button all together or add a specific css class to it. Not by changing the gem source, but by adding the following to the bottom of /config/initializers/activeadmin.rb and so dynamically opening up the private module method

    module ActiveAdmin
      class Resource
        module ActionItems
          private
            def add_default_action_items
              # New Link on all actions except :new and :show
              add_action_item :except => [:new, :show] do
                if controller.action_methods.include?('new')
                  link_to(I18n.t('active_admin.new_model', :model =>       active_admin_config.resource_name), new_resource_path)
                end
              end
    
              # Edit link on show
              add_action_item :only => :show do
                if controller.action_methods.include?('edit')
                  link_to(I18n.t('active_admin.edit_model', :model =>       active_admin_config.resource_name), edit_resource_path(resource))
                end
              end
    
              # Destroy link on show
              add_action_item :only => :show do
                if controller.action_methods.include?("destroy")
                  link_to(I18n.t('active_admin.delete_model', :model =>       active_admin_config.resource_name),
                    resource_path(resource),
                    :method => :delete, :confirm =>       I18n.t('active_admin.delete_confirmation'),
                    :class => 'Anjan_styles_its_own_destroy_button_class')
                end
              end
            end          
        end
      end
    end
    

    Now, you can style your way around, or you could just comment the whole destroy link away. The index screen still has delete links for resources. Dont forget to restart the server.

    Good luck reading source!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Rails v2.1, lets say you have an action for a controller that is
I just using activeadmin gem: rails generate active_admin:resource Team rails generate active_admin:resource Players app/models
I'm using rails-settings by Squeegy from https://github.com/Squeegy/rails-settings as well as Activeadmin . What I'm
Using Rails 3.1.3 with Ruby 1.9.3p0. I've discovered that by default, Rails does not
I'm using active admin in my rails 3.0.9 app with the default setup.i.e I
I'm using ActiveAdmin (0.4.0) with Rails (3.1.1). I can't find a nice way/hack to
I'm using Rails with ActiveAdmin gem. And I want to select some information from
I'm using Rails 3, ActiveAdmin and Kaminari. I have this on the documents.rb file
I'm trying to override the index action of the ActiveAdmin controller for it to
I'm making an application using rails and activeadmin. I want to use the same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.