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

  • Home
  • SEARCH
  • 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 6665009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:40:38+00:00 2026-05-26T02:40:38+00:00

Overriding a new controller without ‘new!’ does not display ActiveAdmin layout. But then when

  • 0

Overriding a new controller without ‘new!’ does not display ActiveAdmin layout. But then when I added ‘new!’ nested ‘synchronization’ form is not appearing although I did ‘@resource.build_synchronization’. Not so sure what I’m doing wrong here.

case #1 (ActiveAdmin layout is gone)

ActiveAdmin.register Resource do
  controller do
      # This code is evaluated within the controller class
      def new
        @resource = Resource.new
        @resource.build_synchronization
      end
  end
end

case #2 (nested form synchronization does not appear)

ActiveAdmin.register Resource do
  controller do
      # This code is evaluated within the controller class
      def new
        @resource = Resource.new
        @resource.build_synchronization
        new!

      end
  end
end

views\admin\resources\new.html.erb

<%= semantic_form_for [:admin, @resource] do |form| %>
    <%= form.inputs "Resource", :id => "resource" do %>
        <%= form.input :name %>
        <%= form.semantic_fields_for :synchronization do |sync| %>
            <% sync.inputs  :name => "Synchronization", :id => "synchronization"  do %>
                <%= sync.input :start_datetime, :as => :datetime %>
                <%= sync.input :repeat_interval, :as => :radio, :collection => @intervals %>
                <%= sync.input :repeat_type, :as => :select, :collection => ["Manual", "Automatic"] %>
            <% end %>
        <% end %>
    <% end %>
    <%= form.buttons %>
<% end %>
<% end %>

models:

class Resource < ActiveRecord::Base
  has_one :synchronization
  accepts_nested_attributes_for :synchronization
end


class Synchronization < ActiveRecord::Base
  belongs_to :resource
  has_many :mappings
  accepts_nested_attributes_for :mappings
  #validates_presence_of :start_datetime
end
  • 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-05-26T02:40:38+00:00Added an answer on May 26, 2026 at 2:40 am

    You need to put the form.semantic_fields_for statement inside a form.inputs block.

    Also, I would not put form.buttons inside neither the form.semantic_fields_for block nor a form.inputs block. It should be a direct child under the semantic_form_for block (this is not what is causing your problem, but just the location where you would normally put this).

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

Sidebar

Related Questions

I am new to git but have spent a good deal of time reading
I'm using a inherited controller for an abstracted class. I'm trying to avoid overriding
In my ASP.NET MVC app, I'm handling errors by overriding OnException in the controller.
In a standard Rails controller, I'd create a record like this: @user = User.new(params[:user])
I know Microsoft themselves used to recommend overriding operator new with calls to HeapCreate()
When overriding the MembershipProvider and calling it directly, is there a way to fill
When overriding the equals() function of java.lang.Object, the javadocs suggest that, it is generally
when overriding the loadView method in UIViewController, should one call [super loadView] in the
I'm overriding WndProc, so I want to write code like if (m.Msg == WM_COMMAND)
I am overriding a Grid, adding some customer features. One of the features is

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.