Skip to content

Instantly share code, notes, and snippets.

@delba
Last active December 17, 2015 00:29
Show Gist options
  • Select an option

  • Save delba/5521534 to your computer and use it in GitHub Desktop.

Select an option

Save delba/5521534 to your computer and use it in GitHub Desktop.
Title helper
<!DOCTYPE html>
<html>
<head>
<title><%= content_for?(:title) ? yield(:title) : "ApplicationName" %></title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
module ApplicationHelper
def title(title)
provide :title, "#{title} · ApplicationName"
end
end
<% title @item.title %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment