On the index page of MyController I set the value to flash[:notice] :
class MyController < ApplicationController def index flash[:notice] = "my message" ... end end
I see "my message" as expected.
However, when I click on the link on this page that points to the index page of MyOtherController , I still see "my message" :
class MyOtherController < ApplicationController def index puts "----------------------------------------" puts flash[:notice] # => "my message" puts "----------------------------------------" end end
I thought flash[:notice] becomes empty with every request, but this is not the case here. What is the correct way to reset flash[:notice] ?
source share