title: error: Too many redirects
body: <p>I'm using <code>devise</code> and trying the next following:</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
     protect_from_forgery
     before_filter :is_worker
  
     def is_worker
       if user_signed_in?
          @email = current_user.email
          if @email &amp;&amp; Worker.find_by_email(@email).nil?
            redirect_to '/tasksadmins'
          else
             redirect_to '/workers'
          end
       else
           redirect_to '/users/sign_in'
       end
     end
  end
  </code></pre>
  
  <p>when I try to enter the site: <code>localhost:3000/tasksadmins</code>, I got:</p>
  
  <pre><code>Oops! It was not possible to show this website
  
  The website at http://localhost:3000/tasksadmins seems to be unavailable. The precise error was:
  
  Too many redirects
  
  It could be temporarily switched off or moved to a new address. Don't forget to check that your internet connection is working correctly.
  </code></pre>
  
  <p>How can I fix it please?</p>