-
-
Save caffo/4644334 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flash_message | |
types = { :notice => 'success', :alert => 'error', :info => 'info' } | |
flash.inject("") do |sum, message| | |
content_tag :div, :class => "alert alert-#{types[message[0]]}" do | |
button_tag('×'.html_safe, :type => 'button', :class => 'close', :'data-dismiss' => 'alert', :name => nil) + | |
message[1] | |
end | |
end | |
end |
I hope justice is made in the afterlife.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hope people like it. Took me hours to come up with such nice helper.