Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ What if your view headline is different from your page title?
<%= title "My page title", "My headline" %>


Mr. T says, ‘Use my method, fool!’
Mr. ST says, ‘Use my method, fool!’
==================================

Just like ERB's HTML safe method, you can invoke Headliner with a single letter alias.

<h1><%=t "My page title" %></h1>

Note: this alias conflicts with the Rails Internationalization (I18n) API translation method (since it provides the same alias). If you're app requires I18n support, you should use one of [these](http://github.com/nivanson/headliner) [forks](http://github.com/galfert/headliner) on Github.
<h1><%=st "My page title" %></h1>


How does it work?
Expand Down
4 changes: 2 additions & 2 deletions lib/headliner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def display_title(options)
content_tag :title, options[:site]
end

# Mr. T says, "Use my method, fool!"
alias t title
# Mr. ST says, "Use my method, fool!"
alias st title

end
2 changes: 1 addition & 1 deletion spec/headliner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

it "should respond to 'title' helper alias" do
@view.should respond_to(:t)
@view.should respond_to(:st)
end

end
Expand Down