# Page title helper Ever wondered if there was an easier and DRY-way to set your page titles (and/or headings). Backed by Rails (only tested on 2.3.x) and it's new `I18n`-class the solution is a simple helper method. In your layout add this to your `
-section`: ...Option | Description | Default | Values |
---|---|---|---|
:app | Specify the applications name, however it's recommended to define the translation key :'app.name'. | Inflected from RAILS_ROOT | string |
:default | String which is displayed when no translation exists and no custom title has been specified. Can also be set to a symbol or array to take advantage of I18n.translates :default option. | :'app.tagline' | string, symbol or array of those |
:format | Defines the output format, accepts a string containing multiple interpolations, or a symbol to a format alias, see More fun with :format. If set to +false+, just the current title is returned. | :default | string, symbol |
:suffix | Not happy with the fact that the translations must be named like en -> contacts -> index -> title, but prefer e.g. them to be suffixed with page_title? Then just set :suffix => :page_title. | :title | symbol or string |