aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorJames Coleman <jtc331@gmail.com>2015-11-02 08:45:28 -0500
committerXavier Noria <fxn@hashref.com>2015-11-11 07:08:20 +0100
commit8c9e95f97056dc91d198a5974431e4d5b8be325e (patch)
tree0068ea0dc3e24a59770d1bb92c0fe641c563e18e /guides
parentf87774bb8b3249dbcd1f16035874f9e583df82d0 (diff)
downloadrails-8c9e95f97056dc91d198a5974431e4d5b8be325e.tar.gz
rails-8c9e95f97056dc91d198a5974431e4d5b8be325e.tar.bz2
rails-8c9e95f97056dc91d198a5974431e4d5b8be325e.zip
Clarify i18n active[model/record] key differences
I spent a decent amount of time the other day trying to figure out why my active model including class wasn't generating the properly localized validation messages, and a note like this would have saved me a lot of time.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/i18n.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md
index 87d2fafaf3..8381636196 100644
--- a/guides/source/i18n.md
+++ b/guides/source/i18n.md
@@ -805,6 +805,8 @@ en:
Then `User.human_attribute_name("gender.female")` will return "Female".
+NOTE: If you are using a class which includes `ActiveModel` and does not inherit from `ActiveRecord::Base`, replace `activerecord` with `activemodel` in the above key paths.
+
#### Error Message Scopes
Active Record validation error messages can also be translated easily. Active Record gives you a couple of namespaces where you can place your message translations in order to provide different messages and translation for certain models, attributes, and/or validations. It also transparently takes single table inheritance into account.