Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise timedout error showing `true`

When my session expired, Devise is giving me a nonsense error like below:

enter image description here

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?

like image 515
hsym Avatar asked Sep 04 '12 02:09

hsym


1 Answers

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.

like image 171
caarlos0 Avatar answered Sep 19 '22 15:09

caarlos0