Add a helper for twitter-style alert banners #164

Merged
merged 1 commit into from Mar 25, 2012
@@ -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