Changing devise routes like '/users/sign_in' to '/sign_in'
In many of the applications built with the help of Devise sometimes you need to change the devise routes like '/users/sign_in' to simply '/sign_in'
1.)config/routes.rb
devise_for :users, :controllers => {registrations: 'registrations'}, :skip => [:sessions]devise_scope :user doget "/sign_up" => "devise/registrations#new", :as => :new_one_user_registrationget '/sign_in' => "devise/sessions#new", :as => :new_user_sessionget '/forgot_password' => "devise/passwords#new", :as => :new_passwordget '/confirmation' => "devise/confirmations#new", :as => :new_confirmationpost '/sign_in' => 'devise/sessions#create', :as => :user_sessiondelete '/sign_out' => 'devise/sessions#destroy', :as => :destroy_user_sessionauthenticated :user doroot 'projects#index', as: :rootendunauthenticated doroot 'devise/sessions#new', as: :unauthenticated_rootendendend
Then define your path where you want it to be
Comments
Post a Comment