diff options
author | James Coleman <jtc331@gmail.com> | 2015-11-02 08:45:28 -0500 |
---|---|---|
committer | James Coleman <jtc331@gmail.com> | 2015-11-08 15:34:32 -0500 |
commit | 981fa97320e68b768e1b080d168696c6446a4563 (patch) | |
tree | cc728fa51708ea54c55fbd3242ff7be9d32dd28e | |
parent | 6011ab853c0b843e0aa139ca90a5e4ab9ec143c2 (diff) | |
download | rails-981fa97320e68b768e1b080d168696c6446a4563.tar.gz rails-981fa97320e68b768e1b080d168696c6446a4563.tar.bz2 rails-981fa97320e68b768e1b080d168696c6446a4563.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.
-rw-r--r-- | guides/source/i18n.md | 2 |
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. |