title: Redirecting issues when user cannot sign in using Devise
body: <p>In my application I authenticate users using Devise and I noticed that you can change the page that one is redirected to if the sign in fails. On the wiki I found the following example:</p>
  
  <pre><code>class CustomFailure &lt; Devise::FailureApp
    def redirect_url
      new_user_session_url(:subdomain =&gt; 'secure')
    end
  
    # You need to override respond to eliminate recall
    def respond
      if http_auth?
        http_auth
      else
        redirect
      end
    end
  end
  </code></pre>
  
  <p>Following this example I created my own CustomFailure class(custom_failure.rb) and placed in the helper folder (not sure where to put it). This is the following class I created:</p>
  
  <pre><code>class CustomFailure &lt; Devise::FailureApp
    def redirect_url
      new_user_session_url(:subdomain =&gt; 'secure')
    end
  
    # Redirect to root_url
    def respond
      if http_auth?
        http_auth
      else
        root_url
      end
    end
  end
  </code></pre>
  
  <p>I also added the following in the config/initializers/devise.rb file (as the wiki states should be done):</p>
  
  <pre><code>config.warden do |manager|
    manager.failure_app = CustomFailure
  end
  </code></pre>
  
  <p>Although I get no errors, when I incorrectly sign in it still redirects to the /users/sign_in page (not the root page) and nothing is loaded (the page is completely white even though the source is not empty). Is there comthing wrong with my CustomFailure class or maybe it is in the wrong folder?</p>
  
  <p>I am using Rails 3.0.1 and Devise 1.1.rc0.</p>
  
  <p>The wiki where this code is found is at: <a href="https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-when-the-user-can-not-be-authenticated" rel="noreferrer">How To: Redirect to a specific page when the user can not be authenticated</a>  </p>