Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #164 from glanotte/master

Add a helper for twitter-style alert banners
  • Loading branch information...
commit e234cf2d07219d8bd4ff1796ac0423502eeb8a26 2 parents ec5b153 + 2239b5a
@seyhunak authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.