aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/i18n.md
diff options
context:
space:
mode:
authorCassidy Kobewka <hello@cassidy.codes>2018-04-16 19:09:45 -0400
committerCassidy Kobewka <hello@cassidy.codes>2018-04-16 19:09:45 -0400
commit3137a8739e7cb0885cb3f9f631dbca8107448ce5 (patch)
treef566d8e3500971056b16b98322f9d709667eac53 /guides/source/i18n.md
parent2aa8e0a56f39f0a44f4deb19c856314a7a473b2f (diff)
downloadrails-3137a8739e7cb0885cb3f9f631dbca8107448ce5.tar.gz
rails-3137a8739e7cb0885cb3f9f631dbca8107448ce5.tar.bz2
rails-3137a8739e7cb0885cb3f9f631dbca8107448ce5.zip
Use string-based fields. [ci skip]
Diffstat (limited to 'guides/source/i18n.md')
-rw-r--r--guides/source/i18n.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md
index f1b6128762..f42ab15b8b 100644
--- a/guides/source/i18n.md
+++ b/guides/source/i18n.md
@@ -857,12 +857,12 @@ In the event you need to access nested attributes within a given model, you shou
en:
activerecord:
attributes:
- user/subscribed_to_newsletter:
- true: "True"
- false: "False"
+ user/role:
+ admin: "Admin"
+ contributor: "Contributor"
```
-Then `User.human_attribute_name("subscribed_to_newsletter.true")` will return "True".
+Then `User.human_attribute_name("role.admin")` will return "Admin".
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.