diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-04-16 23:07:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 23:07:43 -0400 |
commit | 5003d5996a3d29d6614ccf714ad05f911aa30cff (patch) | |
tree | 1d12f6d41c15b45aaaec7bf6210ed0b095aed87b /guides/source | |
parent | 75210560f1b50e0750def1700e54ffb1fa80c64c (diff) | |
parent | 3137a8739e7cb0885cb3f9f631dbca8107448ce5 (diff) | |
download | rails-5003d5996a3d29d6614ccf714ad05f911aa30cff.tar.gz rails-5003d5996a3d29d6614ccf714ad05f911aa30cff.tar.bz2 rails-5003d5996a3d29d6614ccf714ad05f911aa30cff.zip |
Merge pull request #32582 from cassidycodes/better-examples
Inclusive Language in Documentation Examples
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/action_view_overview.md | 4 | ||||
-rw-r--r-- | guides/source/i18n.md | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index c01d1082b6..37b8843d1e 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -1267,8 +1267,8 @@ password_field_tag 'pass' Creates a radio button; use groups of radio buttons named the same to allow users to select from a group of options. ```ruby -radio_button_tag 'gender', 'male' -# => <input id="gender_male" name="gender" type="radio" value="male" /> +radio_button_tag 'favorite_color', 'maroon' +# => <input id="favorite_color_maroon" name="favorite_color" type="radio" value="maroon" /> ``` #### select_tag diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 339b356a78..f42ab15b8b 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -829,14 +829,14 @@ For example when you add the following translations: en: activerecord: models: - user: Dude + user: Customer attributes: user: login: "Handle" # will translate User attribute "login" as "Handle" ``` -Then `User.model_name.human` will return "Dude" and `User.human_attribute_name("login")` will return "Handle". +Then `User.model_name.human` will return "Customer" and `User.human_attribute_name("login")` will return "Handle". You can also set a plural form for model names, adding as following: @@ -845,11 +845,11 @@ en: activerecord: models: user: - one: Dude - other: Dudes + one: Customer + other: Customers ``` -Then `User.model_name.human(count: 2)` will return "Dudes". With `count: 1` or without params will return "Dude". +Then `User.model_name.human(count: 2)` will return "Customers". With `count: 1` or without params will return "Customer". In the event you need to access nested attributes within a given model, you should nest these under `model/attribute` at the model level of your translation file: @@ -857,12 +857,12 @@ In the event you need to access nested attributes within a given model, you shou en: activerecord: attributes: - user/gender: - female: "Female" - male: "Male" + user/role: + admin: "Admin" + contributor: "Contributor" ``` -Then `User.human_attribute_name("gender.female")` will return "Female". +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. |