From 2239b5a54533cc14ab7abad08d306f94f62deba0 Mon Sep 17 00:00:00 2001 From: Geoff Lanotte Date: Sat, 24 Mar 2012 18:57:31 -0400 Subject: [PATCH] add a flash helper to use the twitter style alert banners --- app/helpers/flash_block_helper.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/helpers/flash_block_helper.rb diff --git a/app/helpers/flash_block_helper.rb b/app/helpers/flash_block_helper.rb new file mode 100644 index 00000000..61a44290 --- /dev/null +++ b/app/helpers/flash_block_helper.rb @@ -0,0 +1,17 @@ +module FlashBlockHelper + def flash_block + output = '' + flash.each do |type, message| + output += flash_container(type, message) + end + + raw(output) + end + + def flash_container(type, message) + raw(content_tag(:div, :class => "alert alert-#{type}") do + content_tag(:a, raw("×"),:class => 'close', :data => {:dismiss => 'alert'}) + + message + end) + end +end