在Rails 4應用程序中,增加單個閃存[:錯誤]消息顯示持續時間的最簡單/最好的方法是什麼?Rails增加閃存[:錯誤]消息的持續時間
,做消息的代碼是在一個控制器和相關的部分看起來像這樣:
else
flash[:notice] = t(:no_new_media, source: @channel.external_source.capitalize)
flash[:error] = @error['message'] if @error.present?
redirect_to admin_channel_path(@channel)
end
我想增加錯誤信息的顯示時間,但我不在乎無論哪種方式關於通知
https://stackoverflow.com/questions/21467157/how-do-i-dismiss-a-rails-flash-message-after-some-duration – Pavan