Add flash type in application controller
# app/controller/application_controller.rb
class ApplicationController
add_flash_types :original_type, :second_one
end
How to use (Example)
-# app/views/layouts/application.html.haml
- if flash.present?
- flash.each_with_index do |(type, msg), index|
%div(class="flash flash-#{type}")
.alertBlock
%p= msg
:coffee
if typeof timerID != 'undefined'
clearTimeout timerID
timerID = setTimeout ->
$('.alert.floating').animate {
opacity: 0
}, 300, ->
$('.alert.floating').css 'display', 'none'
, 1700