aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorKarel Minarik <karmi@karmi.cz>2009-03-01 13:03:26 +0100
committerKarel Minarik <karmi@karmi.cz>2009-03-01 13:03:26 +0100
commit61656cf7702f46fcbb810a70bf0298ac5ea6c0d3 (patch)
treefc6f6897cd8aca71ee2e9eaebfdd73a828a9f700 /railties
parenta6f1e42c096a626b8a071094545d35f90d19ab55 (diff)
downloadrails-61656cf7702f46fcbb810a70bf0298ac5ea6c0d3.tar.gz
rails-61656cf7702f46fcbb810a70bf0298ac5ea6c0d3.tar.bz2
rails-61656cf7702f46fcbb810a70bf0298ac5ea6c0d3.zip
Fixed incorrect examples of ActiveRecord error message lookup in the I18N guide [Thanks Alex Fortuna]
See http://www.ruby-forum.com/topic/179273
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/i18n.textile10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile
index bb17e1ffc4..4d9232917d 100644
--- a/railties/guides/source/i18n.textile
+++ b/railties/guides/source/i18n.textile
@@ -705,20 +705,20 @@ end
The key for the error message in this case is +:blank+. Active Record will lookup this key in the namespaces:
<ruby>
-activerecord.errors.messages.models.[model_name].attributes.[attribute_name]
-activerecord.errors.messages.models.[model_name]
+activerecord.errors.models.[model_name].attributes.[attribute_name]
+activerecord.errors.models.[model_name]
activerecord.errors.messages
</ruby>
Thus, in our example it will try the following keys in this order and return the first result:
<ruby>
-activerecord.errors.messages.models.user.attributes.name.blank
-activerecord.errors.messages.models.user.blank
+activerecord.errors.models.user.attributes.name.blank
+activerecord.errors.models.user.blank
activerecord.errors.messages.blank
</ruby>
-When your models are additionally using inheritance then the messages are looked up for the inherited model class names are looked up.
+When your models are additionally using inheritance then the messages are looked up in the inheritance chain.
For example, you might have an Admin model inheriting from User: