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 8138257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:26:06+00:00 2026-06-06T11:26:06+00:00

I have a infrastructure object composed for many datacenters. In the apps/admin/infrastructures.rb I have

  • 0

I have a infrastructure object composed for many datacenters. In the apps/admin/infrastructures.rb I have the following code:

form do |f|
  f.inputs "Infrastructure details" do
    f.input :name

    f.has_many :datacenters do |datacenter_form|
      datacenter_form.input :name        
    end
  end
  f.buttons
end

I can add datacenters with no problems but I don’t know how I can delete it from infrastructure form.

  • 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-06T11:26:08+00:00Added an answer on June 6, 2026 at 11:26 am

    Sep 2017 Update:

    Rails 5.1.4, ActiveAdmin 1.0.0

    Append :id and _destroy in permit_params along with other attributes from the model e.g. :name in your case. Then provide the :allow_destroy option in f.has_many too. Other requirements remain the same; like adding allow_destroy: true in accepts_nested_attributes_for.

    Final look:

    ActiveAdmin.register Infrastructure do
      permit_params :name, datacenters_attributes: [:id, :_destroy, :name]
    
      form do |f|
        f.inputs "Infrastructure details" do
          f.input :name
    
          f.has_many :datacenters, heading: false,
                                   allow_destroy: true,
                                   new_record: false do |datacenter_form|
            datacenter_form.input :name        
          end
        end
        f.buttons
      end
    end
    

    ActiveAdmin Reference


    This worked for me:

         i.input :_destroy, as: :boolean
    

    and in the Model remember to add :allow_destroy :

         accepts_nested_attributes_for :images, allow_destroy: true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In PHP, say that you have some code like this: $infrastructure = mt_rand(0,100); if
Pardon me for the lengthy description: I have the following infrastructure where I am
I have the following code: public void DeleteAccountsForMonth(int year, int month) { var result
In our infrastructure we have several nodes with different capabilities (in terms of services).
I have my NHibernateUtil class in the infrastructure layer of my application, however I
I have 4 projects: Core (IServer): System System.Core DependencyResolver: Core StructureMap Infrastructure (Service): Core
have written this little class, which generates a UUID every time an object of
I have an application that consists of a WPF UI with an infrastructure layer
I have a simple messaging queue setup and running using the Zend_Queue object heirarchy.
I've created the infrastructure for a new project using DDD principles. I have repositories

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.