【发布时间】:2013-01-31 11:16:33
【问题描述】:
我使用 flash[:notice] 显示成功消息,使用 flash[:warning] 显示警告和错误消息。
即使在重定向到另一个页面时,Flash[:notice] 也可以正常工作,但 flash[:warning] 不能用于重定向。
当我签入我的视图文件时,flash[:warning] 作为 nil 传递。
如何将 flash[:warning] 与 redirect_to 一起使用?
【问题讨论】:
-
使用 flash[:error] 警告/错误
-
问题是我使用 flash[:notice] 来显示绿色的 flash 消息和 flash[:error] 来显示红色的 flash 消息和 flash[:warning] 来显示 flash 消息橙色。我的 flash[:notice] 和 flash[:error] 工作正常,但我的 flash[:warning] 不行。
-
你在特定视图中写过吗?
标签: ruby-on-rails flash-message