-1
设置这样的闪光消息后:闪光灯消息不显示重定向后
flash[:notice] = "Invalid Username or Password"
format.html { redirect_to :action => :log}
重定向发生,但不显示
设置这样的闪光消息后:闪光灯消息不显示重定向后
flash[:notice] = "Invalid Username or Password"
format.html { redirect_to :action => :log}
重定向发生,但不显示
闪光灯消息尝试在重定向方法设置flash[:notice]
:
format.html { redirect_to :action => :log, notice: "Invalid Username or Password}
这相当于。问题很可能是闪光灯消息在控制器中设置,但不显示在视图中。 – Thilo
你是对的@Thilo –
当没有重定向时闪光灯显示? –
显示闪光消息不会自动发生。向我们展示您要重定向到的页面的模板。 – Thilo