Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Created June 18, 2012 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziadoz/2951170 to your computer and use it in GitHub Desktop.
Save ziadoz/2951170 to your computer and use it in GitHub Desktop.
Rails 3 Page Title Breadcrumb
module ApplicationHelper
def build_page_title(*crumbs)
crumbs.map(&:to_s).reject(&:empty?).join(' - ')
end
end
<!DOCTYPE html>
<html>
<head>
<title><%= build_page_title 'Hello', 'Awesome', 'World' %></title>
</head>
<body>
<%= yield %>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment