When redirecting use
flash[:notice] = "This message value is available in next request-response cycle"
When rendering use
flash.now[:notice] = "Message is available in same request-response cycle"
Info from here