Flash message appears twice (redux)
greggilbert opened this issue · comments
Greg commented
Hey. Following #196, #260, etc., I'm having the double flash issue again in Hanami 1.3.1 (also 1.3.0).
module Web
class Failure
include Web::Action
def call(params)
# shortened for brevity
msg = "Something went wrong, try again!"
flash[:message] = msg
redirect_to routes.login_path
end
end
end
module Web
class Index
include Web::Action
include Hanami::Action::Session
expose :message
def call(params)
message = flash[:message]
if message
@message = message
end
end
end
end
As with some of the previous tickets, adding a before { flash.clear }
fixes it. Am I not doing something right here?
Luca Guidi commented
@GustavoCaso Would you mind to check if this is a flash regression? Thanks.
Luca Guidi commented
@greggilbert What's the previous Hanami version you were on?
Gustavo Caso commented
@jodosha Of course. I will find some time this week to have a look at it.
@greggilbert would be able to provide a copy of your Gemfile?