fix label_for_field of LabelledFormBuilder always has class="error" in label tag
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9618 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b4350ca91a
commit
ad8193dcde
|
@ -41,7 +41,7 @@ class Redmine::Views::LabelledFormBuilder < ActionView::Helpers::FormBuilder
|
|||
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.html_safe,
|
||||
:class => (@object && @object.errors[field] ? "error" : nil),
|
||||
:class => (@object && @object.errors[field].present? ? "error" : nil),
|
||||
:for => (@object_name.to_s + "_" + field.to_s))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue