1
我登錄後,然後如果我去/用戶/編輯頁面我得到的Flash消息 「您已成功登錄」。設計顯示其他頁面中的Flash消息
在註冊控制器我想:
flash.now # either this or below one
flash.discard
同我嘗試了佈局像
<% if flash[:alert] || flash[:error] || flash[:notice] %>
<%= content_tag :div, :class => "alert alert-info info-inside" do -%>
<button class="close" data-dismiss="alert">×</button>
<%= flash.now[:alert] if flash[:alert] %>
<%= flash.now[:error] if flash[:error] %>
<%= flash.now[:notice] if flash[:notice] %>
<% end -%>
<% end %>
另外,如果我創造產品並得到了其他頁面它顯示了錯誤的閃存messages.On刷新它去遠。
請告訴我如何避免這種Flash消息。我在我的佈局文件中以及需要的控制器中嘗試了flash.now和flash.discard。但它並沒有幫助我。