Browse Source

Add container and better control over notices

Chris Oliver 7 years ago
parent
commit
43306e2782
2 changed files with 8 additions and 11 deletions
  1. 0 10
      app/helpers/application_helper.rb
  2. 8 1
      app/views/shared/_notices.html.erb

+ 0 - 10
app/helpers/application_helper.rb

@@ -7,14 +7,4 @@ module ApplicationHelper
       notice: "alert-info"
     }.stringify_keys[flash_type.to_s] || flash_type.to_s
   end
-
-  def flash_messages(opts={})
-    flash.each do |msg_type, message|
-      concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)}") do
-        concat content_tag(:button, content_tag(:span, "×"), class: "close", data: { dismiss: 'alert' })
-        concat message
-      end)
-    end
-    nil
-  end
 end

+ 8 - 1
app/views/shared/_notices.html.erb

@@ -1 +1,8 @@
-<%= flash_messages %>
+<% flash.each do |msg_type, message| %>
+  <div class="alert <%= bootstrap_class_for(msg_type) %>">
+    <div class="container">
+      <button class="close" data-dismiss="alert"><span>×</span></button>
+      <%= message %>
+    </div>
+  </div>
+<% end %>