From 55002ee2f486f30dffc4e15e4c3453060446b77e Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 18 Jul 2012 14:09:02 -0400 Subject: [PATCH] hack to fix nested model associations --- app/helpers/rails_admin/form_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/rails_admin/form_builder.rb b/app/helpers/rails_admin/form_builder.rb index 794af1c612..ca680ee486 100644 --- a/app/helpers/rails_admin/form_builder.rb +++ b/app/helpers/rails_admin/form_builder.rb @@ -43,7 +43,7 @@ def fieldset_for fieldset, nested_in def field_wrapper_for field, nested_in if field.label # do not show nested field if the target is the origin - unless field.inverse_of.presence && field.inverse_of == nested_in + unless field.inverse_of.presence && field.inverse_of == nested_in && @template.instance_variable_get(:@model_config).label == field.label @template.content_tag(:div, :class => "control-group #{field.type_css_class} #{field.css_class} #{'error' if field.errors.present?}", :id => "#{dom_id(field)}_field") do label(field.method_name, field.label, :class => 'control-label') + (field.nested_form ? field_for(field) : input_for(field))