-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the documentation of the format and of interpolations #56
Comments
I guess this is more a case of bad documentation or confusing documentation. page_title format: ':title | :app :env', default: :'app.tagline', app: 'MyApp'
# The format string is then passed through the extrapolations and
#
# :title -> gets replaced by the title, or if there is no tagline by the option `default`
# :app -> gets replaced by the app.name or in our case by the option `app`
# :env -> if a custom registration was registered it would be replaced... like:
PageTitleHelper.interpolates :env do |env|
"[#{Rails.env}]" unless Rails.env.production?
end does this clarify the usage of default, but reading the docs just now I had to double check it too :) |
Okay, then the documentation indeed needs some improvements. :-) I've updated the ticket title accordingly. |
Note to self: These are the interpolations I have been able to find so far: :title -> namespace.controller.action.title |
Check out
|
I'm using this in my HAML page layout:
If I understand the docs correctly, this should result in the translated app.tagline, a pipe, and the app.name. However, :default is output unreplaced. Am I understanding the docs incorrectly, or is this a bug?
(:app.tagline does not work either - in that case, only :app gets substituted with the translated app.name.)
The text was updated successfully, but these errors were encountered: