To change the default sign_in and sign_out routes for devise, add your new routes to your routes.rb using the devise_scope.

  devise_scope :user do
    get "/login" => "devise/sessions#new"
    delete "/logout" => "devise/sessions#destroy"

Once you've added the devise scope you will notice that your devise sign_in and sign_out routes have changed. Here is the output of rake routes with the new routes.

           login GET    /login(.:format)                devise/sessions#new
          logout DELETE /logout(.:format)               devise/sessions#destroy

You now need to change your login and logout links in your views to reflect the new routes.

    <% if user_signed_in? %>
      <%= link_to("Logout", logout_path, :method => :delete) %>
    <% else %>
      <%= link_to("Login", login_path, {:class => this_page?(new_user_session_path)}) %>
    <% end %>

If you want to change the path to where the user is redirected after sign in from the root path add the new path inside your application controller by defining the after_sign_in_path_for method.

class ApplicationController < ActionController::Base

  def after_sign_in_path_for(resource)