Skip to content

Instantly share code, notes, and snippets.

@swalberg
Created November 29, 2011 21:43
Show Gist options
  • Save swalberg/1406679 to your computer and use it in GitHub Desktop.
Save swalberg/1406679 to your computer and use it in GitHub Desktop.
application helper:
def title(phrase, container=nil)
@page_title ||= phrase
content_tag(container, phrase) if container
end
layout:
<title><%= @page_title || "Default page title" %></title>
view:
<% title "I like this title" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment