summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-08 21:01:12 +0100
committerAzul <azul@leap.se>2012-11-08 21:01:12 +0100
commit2f44497b6206ad7b31e7444f52609cb3e56b8ab5 (patch)
tree6649bd030db64cd7879ba856ce2423343005f84e /app/views
parentce65965c536ed873d30246db074b5236d3185f47 (diff)
added generic flash block
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/_messages.html.haml5
-rw-r--r--app/views/layouts/application.html.haml2
2 files changed, 6 insertions, 1 deletions
diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml
new file mode 100644
index 0000000..80e34d4
--- /dev/null
+++ b/app/views/layouts/_messages.html.haml
@@ -0,0 +1,5 @@
+- flash.each do |name, msg|
+ - if msg.is_a?(String)
+ %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
+ %a.close{"data-dismiss" => "alert"} ×
+ = content_tag :div, msg, :id => "flash_#{name}"
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index a57d65e..e6d22f0 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -18,6 +18,6 @@
.content
.row
.span12
- //= render 'layouts/messages'
+ = render 'layouts/messages'
= yield
%footer