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:
Toshi MARUYAMA 2012-05-04 14:33:35 +00:00
parent b4350ca91a
commit ad8193dcde
1 changed files with 1 additions and 1 deletions

View File

@ -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