Skip to content
Browse files

Merge pull request #164 from glanotte/master

Add a helper for twitter-style alert banners
  • Loading branch information...
2 parents ec5b153 + 2239b5a commit e234cf2d07219d8bd4ff1796ac0423502eeb8a26 @seyhunak committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 app/helpers/flash_block_helper.rb
View
17 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

0 comments on commit e234cf2

Please sign in to comment.
Something went wrong with that request. Please try again.