When my session expired, Devise is giving me a nonsense error like below:
Here's my code:
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>"><%= value %></div>
<% end %>
How do I customize it so it doesn't show the true
error?
Yep, it was reported in github devise repo, and they update the readme about that.
I solve it in my app with a code like this:
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert alert-<%= flash_class(level) %> fade in">
<button type="button" class="close" data-dismiss="alert">X</button>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With