Skip to content

Instantly share code, notes, and snippets.

Created March 14, 2014 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anonymous/9549170 to your computer and use it in GitHub Desktop.
Save anonymous/9549170 to your computer and use it in GitHub Desktop.
def insert_flash
content_tag :div, class: 'flash' do
flash.each do |name, msg|
if msg.is_a?(String)
concat( content_tag( :div, class: "fade in alert alert-#{ flash_type_to_bootstrap(name) }") do
concat( button_tag( "×".html_safe, class: "close", "aria-hidden" => true, "data-dismiss" => "alert" ) )
concat( content_tag :div, msg, :id => "flash_#{name}" )
end )
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment