Rails Trick & Tips : Auto hide Rails flash messages bootstrap 3, flash message, rails tips & tricks

Auto hide Rails flash messages

Just drop this coffee script in your assets/javascript folder (look at http://reinteractive.net/posts/13-ui-tips-for-flash-messages-in-rails)

    $ ->
      flashCallback = ->
        $(".alert").fadeOut()
      $(".alert").bind 'click', (ev) =>
        $(".alert").fadeOut()
      setTimeout flashCallback, 3000
      

comments powered by Disqus