diff options
author | Joshua Cody <josh@joshuacody.net> | 2014-05-05 17:48:53 -0500 |
---|---|---|
committer | Joshua Cody <josh@joshuacody.net> | 2014-05-06 14:37:28 -0500 |
commit | d5f2c5c20e2f8f104a1e67ba81166874cc472b9e (patch) | |
tree | 1f5943583d2d867766bd4c97d87de5db47812f93 /actionview/CHANGELOG.md | |
parent | b6bab2af144d3f35ae2e1661286f2e35f43f5d3a (diff) | |
download | rails-d5f2c5c20e2f8f104a1e67ba81166874cc472b9e.tar.gz rails-d5f2c5c20e2f8f104a1e67ba81166874cc472b9e.tar.bz2 rails-d5f2c5c20e2f8f104a1e67ba81166874cc472b9e.zip |
Include label value in i18n attribute lookup
Previously, only the object and method name from the label tag were
used when looking up the translation for a label. If a value is
given for the label, this ought to be additionally used. The
following:
# form.html.erb
<%= form_for @post do |f| %>
<%= f.label :type, value: "long" %>
<% end %>
# en.yml
en:
activerecord:
attributes:
post/long: "Long-form Post"
Used to simply return "long", but now it will return "Long-form
Post".
Diffstat (limited to 'actionview/CHANGELOG.md')
-rw-r--r-- | actionview/CHANGELOG.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index bedbf78172..a6f6ac78db 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -1,3 +1,23 @@ +* Take label values into account when doing I18n lookups for model attributes. + + The following: + + # form.html.erb + <%= form_for @post do |f| %> + <%= f.label :type, value: "long" %> + <% end %> + + # en.yml + en: + activerecord: + attributes: + post/long: "Long-form Post" + + Used to simply return "long", but now it will return "Long-form + Post". + + *Joshua Cody* + * Change `asset_path` to use File.join to create proper paths: https://some.host.com//assets/some.js |