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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:56:20+00:00 2026-06-02T14:56:20+00:00

I am trying to create a custom nested form in RailsAdmin for one of

  • 0

I am trying to create a custom nested form in RailsAdmin for one of my models to add more functionality than the built in widget allows.

I have a Project that has_many TechSpecs. In my rails_admin.rb initializer I have the following

config.model Project do
  edit do
    configure :tech_specs do
      partial 'tech_specs_field'
    end
  end
end

In _tech_specs_field.html.haml (I’m personally more comfortable with erb but I get very odd “no method safe_concat for nil:NilClass” errors unless I use haml) I have

= form.fields_for(field.name) do |nested_form|
  = render :partial => 'spec', :locals => {:nested_form => nested_form}

- add = "<i class='icon-plus icon-white'></i> New Tech Spec".html_safe
= form.link_to_add add, field.name, { :class => 'btn btn-info' }

I can actually see the blueprint for new tech_specs generated on the page in a hidden div at the bottom but clicking the New Tech Spec button does nothing. Inside _spec.html.haml is just a bunch of text_fields and hidden_fields plus the remove link (which does work).

I’m wondering two things:

1) How can I track down what should be happening in JS and fix it or my partial to work with the RailsAdmin nested forms from the bbenezech-nested_form gem (which RailsAdmin depends on)

2) Any ideas as to why my partial had to be in haml other than it’s what RailsAdmin uses and somehow it is incompatible in the massive chain generating the admin 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-02T14:56:22+00:00Added an answer on June 2, 2026 at 2:56 pm

    This isn’t a good final answer but I was able to get around the problem with the following JS hack in ui.js

      var oldNestedFormEvents = window.nestedFormEvents.insertFields
      window.nestedFormEvents.insertFields = function (content, assoc, link) {
        if ($(link).closest('.no_tabs').length > 0) {
          return $(content).insertBefore(link);
        } else {
          return oldNestedFormEvents(content, assoc, link);
        }
      }
    

    On custom partials where I want to use a nested form, I simply add the ‘no_tabs’ class to their containing div and reuse the original insertFields method from bbenezech-nested_forms.

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

Sidebar

Related Questions

Im trying to create a custom version of the RequiredAttribute to replace the built
I am trying to create a custom authentication scheme in ASP.NET MVC using form
Background / Goal More or less, I'm trying to create a nested group of
Im trying to create a custom formatter in Symfony 1.4. I have embedded form
I'm trying to create a custom timestamp field. class TimestampKey(models.CharField): __metaclass__ = models.SubfieldBase def
I'm trying to create a digital clock widget with custom typeface font. I got
I am trying to create custom buttons, and I created one in photoshop and
I'm trying to create a custom UIButton that should look like a UIButtonTypeRoundedRect. In
I'm trying to create a custom component with a collection property. However if I
I'm trying to create a custom button where the foreColor is always crimson and

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.