diff options
author | Xavier Noria <fxn@hashref.com> | 2010-09-03 21:30:22 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-09-03 21:30:22 +0200 |
commit | 93acbf6bf31ca1802d7631c57da693a824456c4a (patch) | |
tree | 0c2be6d2c127abf50572dc86bf7dc182c00bb49c /railties/guides/source | |
parent | d28438caf2342be3df8421ed92b95e0510be8ac0 (diff) | |
parent | f8fb4651a7d8218befce48d66f4fadcea6ece37a (diff) | |
download | rails-93acbf6bf31ca1802d7631c57da693a824456c4a.tar.gz rails-93acbf6bf31ca1802d7631c57da693a824456c4a.tar.bz2 rails-93acbf6bf31ca1802d7631c57da693a824456c4a.zip |
Merge remote branch 'docrails/master'
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/i18n.textile | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index 6018cc44c8..8a7e9fcae6 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -686,6 +686,8 @@ The key for the error message in this case is +:blank+. Active Record will look activerecord.errors.models.[model_name].attributes.[attribute_name] activerecord.errors.models.[model_name] activerecord.errors.messages +errors.attributes.[attribute_name] +errors.messages </ruby> Thus, in our example it will try the following keys in this order and return the first result: @@ -694,6 +696,8 @@ Thus, in our example it will try the following keys in this order and return the activerecord.errors.models.user.attributes.name.blank activerecord.errors.models.user.blank activerecord.errors.messages.blank +errors.attributes.name.blank +errors.messagges.blank </ruby> When your models are additionally using inheritance then the messages are looked up in the inheritance chain. @@ -714,6 +718,8 @@ activerecord.errors.models.admin.blank activerecord.errors.models.user.attributes.title.blank activerecord.errors.models.user.blank activerecord.errors.messages.blank +errors.attributes.title.blank +errors.messagges.blank </ruby> This way you can provide special translations for various error messages at different points in your models inheritance chain and in the attributes, models, or default scopes. |