Created
July 14, 2011 08:36
-
-
Save mikebaldry/1082104 to your computer and use it in GitHub Desktop.
Rails 3.1 page titles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app/views/energy/index.html.haml: | |
| -page_title = "Test title" | |
| %h1 energy page | |
| app/views/layouts/application.html.haml: | |
| %title= page_title | |
| app/helpers/application_helper.rb: | |
| def page_title=(value) | |
| content_for(:page_title) { value } | |
| end | |
| def page_title | |
| content_for(:page_title) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment