Make TabularFormBuilder behave with subforms #586
This commit is contained in:
parent
ec4b42f24f
commit
2753973ffe
|
@ -40,8 +40,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
|
|||
text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label]
|
||||
text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym)
|
||||
text += @template.content_tag("span", " *", :class => "required") if options.delete(:required)
|
||||
@template.content_tag("label", text,
|
||||
:class => (@object && @object.errors[field] ? "error" : nil),
|
||||
:for => (@object_name.to_s + "_" + field.to_s))
|
||||
@template.label(@object_name, field.to_s, text,
|
||||
:class => (@object && @object.errors[field] ? "error" : nil))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue