Commit 2753973f authored by Felix Schäfer's avatar Felix Schäfer Committed by Felix Schäfer

Make TabularFormBuilder behave with subforms #586

parent ec4b42f2
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment