rails中 flash 和 flash.now的区别

Flash[:notice]’s message will persist to the next action and should be used when redirecting to another action via the ‘redirect_to’ method.

flash方法的消息会从保存到下一个action,和redirct_to方法一起使用

Flash.now[:notice]’s message will be displayed in the view your are rendering via the ‘render’ method.

flash.now 方法的详细只会在当前视图显示,不会保存到下一个action,和render方法一起使用

posted on 2018-03-03 09:29  一只猪儿虫  阅读(161)  评论(0编辑  收藏  举报