Permalink
Browse files

stop nested associations from being ignored

  • Loading branch information...
1 parent 2f04eb7 commit 5eb90526c95ccf84b0fe8e19c09bc54dac91c05f @themgt committed Jul 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/helpers/rails_admin/form_builder.rb
View
2 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))

0 comments on commit 5eb9052

Please sign in to comment.