aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-01-07 08:56:57 +0000
committerMichael Koziarski <michael@koziarski.com>2007-01-07 08:56:57 +0000
commit31fb0deec16d1911a9c7892089e4d695f90a6425 (patch)
treea7474c8a572eecd14f505016323f10a1f53043eb /actionpack/lib
parentb4282df966b5b5aa9ce0335662a6c68308a1af43 (diff)
downloadrails-31fb0deec16d1911a9c7892089e4d695f90a6425.tar.gz
rails-31fb0deec16d1911a9c7892089e4d695f90a6425.tar.bz2
rails-31fb0deec16d1911a9c7892089e4d695f90a6425.zip
Fix no method error with error_messages_on. Closes #6935 [nik.wakelin Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5870 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/active_record_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb
index fff22d2688..33eaa13898 100644
--- a/actionpack/lib/action_view/helpers/active_record_helper.rb
+++ b/actionpack/lib/action_view/helpers/active_record_helper.rb
@@ -85,7 +85,7 @@ module ActionView
# <%= error_message_on "post", "title", "Title simply ", " (or it won't work)", "inputError" %> =>
# <div class="inputError">Title simply can't be empty (or it won't work)</div>
def error_message_on(object, method, prepend_text = "", append_text = "", css_class = "formError")
- if object = instance_variable_get("@#{object}") && errors = object.errors.on(method)
+ if (obj = instance_variable_get("@#{object}")) && (errors = obj.errors.on(method))
content_tag("div", "#{prepend_text}#{errors.is_a?(Array) ? errors.first : errors}#{append_text}", :class => css_class)
else
''