Skip to content

Instantly share code, notes, and snippets.

@abitdodgy
Last active August 29, 2015 14:14
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 abitdodgy/0be428b40d9259f5a655 to your computer and use it in GitHub Desktop.
Save abitdodgy/0be428b40d9259f5a655 to your computer and use it in GitHub Desktop.
An application.html.erb layout file for Rails 4 to use with Sublime Text's Insert Gist feature
<% flash.each do |key, message| %>
<%= content_tag :div, class: "alert alert-full-page alert-#{key} alert-dismissable", role: "alert" do %>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<%= message %>
<% end %>
<% end %>
<!DOCTYPE html>
<html>
<head>
<title>
<%= page_title yield(:title) %>
</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render 'flash' %>
<main class="page-wrapper">
<div class="centered-page">
<%= yield %>
</div>
</main>
</body>
</html>
module ApplicationHelper
def page_title(title)
base_title = "Carrefour"
if title.blank?
base_title
else
"#{base_title} - #{title}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment