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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:57:08+00:00 2026-05-28T01:57:08+00:00

I am using ActiveAdmin and Rails 3.1 — having problem understanding whether the following

  • 0

I am using ActiveAdmin and Rails 3.1 — having problem understanding whether the following is a bug, or if there is some way to do it correctly that I am not understanding. I am trying to use a nested model with a has one relationship, so that I can create a page and fill out it’s meta data in 1 step. —
(page has_one meta_data, accepts_nested_attributes_for meta_data)

Example 1)
in this example, when I click new page, meta data section is there but there are no input fields — also, if I edit the record, it shows up correctly, however the fieldset is duplicated in the second section… and if I remove the f.inputs wrapping semantic_field_for (which would make sense), then it breaks completely and shows nothing in the meta data area…

form do |f|
  f.inputs "Page Information" do
    f.input :name
    f.input :uri
    f.input :view
    f.input :body, :as => :text
    f.input :active
  end

  f.inputs "Meta Data" do
    f.semantic_fields_for :meta_data do |meta_form|
      meta_form.inputs :title, :description, :keywords, :name => "Meta Information"
    end
  end  
end

I understand the meta data probably isn’t being instantiated, but I am not sure how I am supposed to do that in the form block? (or if I can even do it) — The only way I am able to get this to work is by doing using a custom form, and building the meta data in the view, which looks like this

2) How I am working around it, but seems hacky

<%= semantic_form_for [:admin, @page] do |f| %>
  <% @page.build_meta_data %>
  <%= f.inputs :name => "Page Information" do  %>
    <%= f.input :name %>
    <%= f.input :uri %>
    <%= f.input :view %>
    <%= f.input :body, :as => :text %>
    <%= f.input :active %>
  <% end %>
  <%= f.semantic_fields_for :meta_data do |meta_form| %>
    <%= meta_form.inputs :title, :description, :keywords, :name => "Meta Information" %>
  <% end %>

  <%= f.buttons %>
<% end %>

Thanks in advance for any help or clarification.

(note to moderators I started another thread on this but was not as clear and didn’t have the workaround solution I do now yet, so if one of the questions should be deleted please delete the other)

  • 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-28T01:57:08+00:00Added an answer on May 28, 2026 at 1:57 am

    I found a better solution for you. You can use :for option in inputs helper.

    f.inputs "Meta Data", for: [:meta_data, f.object.meta_data || MetaData.new] do |meta_form|
      meta_form.input :title
      meta_form.input :description
      meta_form.input :keywords
    end
    

    I think this might work too, but I didn’t check

    f.inputs :title, :desctiption, :keywords, 
      name: "Meta Data",
      for: [:meta_data, f.object.meta_data || MetaData.new]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ActiveAdmin with Rails 3.1. The only images (that I'm aware of) that
I'm using ActiveAdmin (0.4.0) with Rails (3.1.1). I can't find a nice way/hack to
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
I'm using Rails 3, ActiveAdmin and Kaminari. I have this on the documents.rb file
I've got a User resource that I'm using ActiveAdmin to display. Is it possible
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using ActiveAdmin for a rails application (very impressed so far). My question is, when
I'm using ActiveAdmin and Formtastic. I have an invoice form that has a drop
Using online interfaces to a version control system is a nice way to have

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.