Closed tamvm closed 10 years ago
Can you give me the exact steps to reproduce? Login? Checkout?
Are you logged in as an admin or normal user?
Oh, thanks a lot for your quick response. I'm ridiculous with this issue, before on other project, I do the the same, but it worked. To reproduce, please follow following steps:
UserSessionController#test
) def test
flash[:notice] = "asdasd"
flash.keep
redirect_to root_url, flash: {error: "asdasd"}
end
WelcomeController#index
or in welcome/index
view:
puts byebug
and check flash
variable. Thanks for your contribution, the project is so great anyway, it save a lot of my effort.
Does it work on your machine?
I'm not going to have time to test this today. I'm curious if this is a just a rendering issue.
also try alert instead of error
redirect_to root_url, flash: {alert: "asdasd"}
I tested with many ways (include yours) but no luck :(. It's fine, just focus on your work first.
Is this on your local machine? Do you have memcached running?
Yes, it doesn't work on my local, I don't think it's related to memcached, but I also just tried to run memcached inline too, but it doesn't work too. Can't understand.
Finally I knew the problem, I follow the comment in config/initializers/session_store.rb and uncomment the line:
Rails.application.config.session_store ActionDispatch::Session::CacheStore, :expire_after => 30.minutes
I commented that line and now it worked normally. Anyway, thanks for your help, I'm closing this issue right now.
I can't understand why flash message doesn't show after redirect. Is there any suggestion?