Skip to content

Commit

Permalink
add a flash helper to use the twitter style alert banners
Browse files Browse the repository at this point in the history
  • Loading branch information
glanotte committed Mar 24, 2012
1 parent ec5b153 commit 2239b5a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 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 2239b5a

Please sign in to comment.