From 3137a8739e7cb0885cb3f9f631dbca8107448ce5 Mon Sep 17 00:00:00 2001 From: Cassidy Kobewka Date: Mon, 16 Apr 2018 19:09:45 -0400 Subject: Use string-based fields. [ci skip] --- guides/source/i18n.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides/source') 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. -- cgit v1.2.3