Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move flash messages into partials for application layouts

  • Loading branch information...
commit dea679d02644e0e34de53d2f60bdc7e0d5afb998 1 parent 0117714
@DanielKehoe DanielKehoe authored
View
3  files/simple/views/layouts/_messages.html.erb
@@ -0,0 +1,3 @@
+<% flash.each do |name, msg| %>
+ <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
+<% end %>
View
2  files/simple/views/layouts/_messages.html.haml
@@ -0,0 +1,2 @@
+- flash.each do |name, msg|
+ = content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String)
View
4 files/simple/views/layouts/application.html.erb
@@ -15,9 +15,7 @@
<div id="container" class="container">
<header>
<%= render 'layouts/navigation' %>
- <%- flash.each do |name, msg| -%>
- <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
- <%- end -%>
+ <%= render 'layouts/messages' %>
</header>
<div id="main" role="main">
<%= yield %>
View
3  files/simple/views/layouts/application.html.haml
@@ -12,8 +12,7 @@
#container.container
%header
= render 'layouts/navigation'
- - flash.each do |name, msg|
- = content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String)
+ = render 'layouts/messages'
#main{:role => "main"}
= yield
%footer
View
6 files/twitter-bootstrap/views/layouts/_messages.html.erb
@@ -0,0 +1,6 @@
+<% flash.each do |name, msg| %>
+ <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
+ <a class="close" data-dismiss="alert">×</a>
+ <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
+ </div>
+<% end %>
View
4 files/twitter-bootstrap/views/layouts/_messages.html.haml
@@ -0,0 +1,4 @@
+- flash.each do |name, msg|
+ %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
+ %a.close{"data-dismiss" => "alert"} ×
+ = content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String)
View
7 files/twitter-bootstrap/views/layouts/application.html.erb
@@ -25,12 +25,7 @@
<div class="content">
<div class="row">
<div class="span12">
- <% flash.each do |name, msg| %>
- <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
- <a class="close" data-dismiss="alert">×</a>
- <%= msg %>
- </div>
- <% end %>
+ <%= render 'layouts/messages' %>
<%= yield %>
</div>
</div>
View
5 files/twitter-bootstrap/views/layouts/application.html.haml
@@ -21,9 +21,6 @@
.content
.row
.span12
- - flash.each do |name, msg|
- %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
- %a.close{"data-dismiss" => "alert"} ×
- = msg
+ = render 'layouts/messages'
= yield
%footer
Please sign in to comment.
Something went wrong with that request. Please try again.