Optimizes Rails flash messages and hides them after 3 sec