title: Devise routes to only use custom sign in page
body: <p>I am trying to learn Devise and seem to have hit a problem that is nearly the same as many, many questions here on SO but just slightly different enough that I am not getting much traction following those questions' threads.</p>
  
  <p>I have a very simple application. Users can sign in and sign out (and also the devise 'forgot password' stuff is enabled - I am not concerned about it at this time) and that is <em>it</em>. They can't register, they can't edit their profile other than to change their password, they can't do anything except sign in and sign out. (Account creation will, for now, be handled manually at the command line.)</p>
  
  <p>I would vastly prefer that the only page that users can log in from was "/" (<code>root_path</code>). I already have it working where you can log in from "/", and that is great. The problem I am having is that if you type in your user/password combination incorrectly from the root_path login page, it automatically sends you to the Devise sign-in page to continue trying to sign in. <strong>How can I make Devise redirect to root_path on sign-in failure?</strong></p>
  
  <p>Here are my routes - they are probably not optimal or correctly configured and I would appreciate pointers on fixing them:</p>
  
  <pre><code>root to: "core_pages#splash"
  
  devise_for :users, skip: [:sessions]
  as :user do
    # get 'signin' =&gt; 'devise/sessions#new', as: :new_user_session
    post 'signin' =&gt; 'devise/sessions#create', as: :user_session
    delete 'signout' =&gt; 'devise/sessions#destroy', as: :destroy_user_session,
      via: Devise.mappings[:user].sign_out_via
  end
  
  match '/home' =&gt; 'core_pages#home'
  </code></pre>
  
  <p>Note the commented-out 'get signin' line. The system works without this line but, surprisingly (to me), "GET /signin" results in a HTTP 400 (OK) response and renders the Devise login template. I would prefer it return some sort of 'invalid request' or just silently redirect the user to <code>root_path</code>.</p>
  
  <p>Running <code>rake routes</code> on these routes gives:</p>
  
  <pre><code>                root        /                              core_pages#splash
         user_password POST   /users/password(.:format)      devise/passwords#create
     new_user_password GET    /users/password/new(.:format)  devise/passwords#new
    edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                       PUT    /users/password(.:format)      devise/passwords#update
          user_session POST   /signin(.:format)              devise/sessions#create
  destroy_user_session DELETE /signout(.:format)             devise/sessions#destroy
                  home        /home(.:format)                core_pages#home
  </code></pre>
  
  <p>Thanks!</p>