Sha256: 1f2b57e8c5b32a64505c216ff235d03edb91ad7256be34ce19242aaf35ca198f
Contents?: true
Size: 816 Bytes
Versions: 1
Compression:
Stored size: 816 Bytes
Contents
# Title Translations for \<title\>s! ## Usage Add to your translations: ```yaml en: titles: application: AppName dashboards: show: Dashboard users: show: '%{user}' new: Registration ``` And to your HTML: ```erb <title><%= title %></title> ``` And to your `User` model: ```ruby def to_s name end ``` ## Acknowledgement Though the idea of translating titles was arrived at seperately, [Brandon Keepers] wrote [Abusing Rails I18N to Set Page Titles] which outlines an extremely similar approach, and from whence came the idea of using the view context to get local assigns to be used in interpolation. [Brandon Keepers]: https://github.com/bkeepers [Abusing Rails I18N to Set Page Titles]: http://opensoul.org/blog/archives/2012/11/05/abusing-rails-i18n-to-set-page-titles/
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
title-0.0.3 | README.md |