Skip to content

Instantly share code, notes, and snippets.

@caffo
Forked from mdepolli/application_helper.rb
Created January 26, 2013 20:09
Show Gist options
  • Save caffo/4644334 to your computer and use it in GitHub Desktop.
Save caffo/4644334 to your computer and use it in GitHub Desktop.
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
@caffo
Copy link
Author

caffo commented Jan 26, 2013

Hope people like it. Took me hours to come up with such nice helper.

@mdepolli
Copy link

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