I have the following in my controller:
redirect_to signin_path, :notice => "The email is already registered"
In my view I have
<%= flash[:notice] if flash[:notice] %>
But the flash message does not appear.
However if I do the following in the controller
flash[:notice] = "There is already an acount for this email. Please Login to create your board."
redirect_to signin_path
It does work.
What is the reason the first one does not work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…