Created
October 3, 2010 06:48
-
-
Save don-smith/608334 to your computer and use it in GitHub Desktop.
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
<html> | |
<head><title><%= yield(:title) %></title></head> | |
<body> | |
<h1><%= yield(:title) %></h1> | |
<%= yield %> | |
</body> | |
</html> |
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
module ApplicationHelper | |
def title(page_title) | |
content_for(:title) { page_title } | |
end | |
end |
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
require 'spec_helper' | |
describe ApplicationHelper do | |
it 'should render page titles' do | |
page_title = 'Page Title' | |
helper.should_receive :content_for, :title => page_title | |
helper.title page_title | |
end | |
end |
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
<% title 'Awesome title' %> | |
<!-- rest of the page --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment