Created
February 28, 2015 16:23
-
-
Save dacur/0ca87f83184beeda89c8 to your computer and use it in GitHub Desktop.
This is a sample application.html.erb file that adds bootstrap styling to devise alerts. It uses green and red coloring, and adds an 'x' button so that the messages can be dismissed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>YOUR TITLE HERE</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 'layouts/header' %> | |
<div class="container"> | |
<% flash.each do |name, msg| %> | |
<% if msg.is_a?(String) %> | |
<div class="alert alert-<%= name.to_s == 'notice' ? "success" : "danger" %> alert-dismissable"> | |
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
<%= content_tag :div, msg, :id => "flash_#{name}" %> | |
</div> | |
<% end %> | |
<% end %> | |
<%= yield %> | |
<%= render 'layouts/footer' %> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment