aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-03-28 22:14:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-03-28 22:14:04 +0000
commit3704f4ba2e937e32677d461d54fdaa3172a1df8b (patch)
treece447519d956c169dde272f8ab91cfdd67f3ed53 /actionpack
parenta61b63d42056b119e061f7ebf31985887d569c79 (diff)
downloadrails-3704f4ba2e937e32677d461d54fdaa3172a1df8b.tar.gz
rails-3704f4ba2e937e32677d461d54fdaa3172a1df8b.tar.bz2
rails-3704f4ba2e937e32677d461d54fdaa3172a1df8b.zip
Fix new migration versions
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/active_record_helper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb
index 7569cc381d..6b9543c3be 100644
--- a/actionpack/lib/action_view/helpers/active_record_helper.rb
+++ b/actionpack/lib/action_view/helpers/active_record_helper.rb
@@ -203,8 +203,9 @@ module ActionView
alias_method :tag_without_error_wrapping, :tag
def tag(name, options)
- if object.respond_to?("errors") && object.errors.respond_to?("on")
- error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name))
+ if object.respond_to?("errors") && object.errors.respond_to?("on") && object.errors.on(@method_name)
+ # error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name))
+ tag_without_error_wrapping(name, options.merge({ "class" => options["class"] ? "#{options["class"]} errors" : 'errors' }))
else
tag_without_error_wrapping(name, options)
end
@@ -212,8 +213,9 @@ module ActionView
alias_method :content_tag_without_error_wrapping, :content_tag
def content_tag(name, value, options)
- if object.respond_to?("errors") && object.errors.respond_to?("on")
- error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name))
+ if object.respond_to?("errors") && object.errors.respond_to?("on") && object.errors.on(@method_name)
+ # error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name))
+ content_tag_without_error_wrapping(name, value, options.merge({ "class" => options["class"] ? "#{options["class"]} errors" : 'errors' }))
else
content_tag_without_error_wrapping(name, value, options)
end