flash[:notice] & flash[:error] + refresh button = disappearing
My view with flashes
<% unless flash[:notice].blank? %>
<div id="notification_notice"><%= flash[:notice] %></div>
<% end %>
<% unless flash[:error].blank? %>
<div id="notification_error"><%= flash[:error] %></div>
<% end %>
Question: If error or success it shows very nice. But when I;m do refresh my error or notices开发者_运维知识库 are dispersing. Why? How to edit this bug? Or everything is nice in rails?
This is the expected behavior of rails, the flash messages will be cleared after one request.
The flash will be emptied after the next request. To keep it, you can do this in your controller:
flash.keep(:notice)
See the Documentation on FlashHash
精彩评论