Skip to content

Commit

Permalink
hack to fix nested model associations
Browse files Browse the repository at this point in the history
  • Loading branch information
themgt committed Jul 18, 2012
1 parent 58b5dc3 commit 55002ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/rails_admin/form_builder.rb
Expand Up @@ -43,7 +43,7 @@ def fieldset_for fieldset, nested_in
def field_wrapper_for field, nested_in def field_wrapper_for field, nested_in
if field.label if field.label
# do not show nested field if the target is the origin # 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 @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') + label(field.method_name, field.label, :class => 'control-label') +
(field.nested_form ? field_for(field) : input_for(field)) (field.nested_form ? field_for(field) : input_for(field))
Expand Down

0 comments on commit 55002ee

Please sign in to comment.