When you specify controllers: { sessions: "admins/sessions" }, this means that you have a file with a name sessions_controller.rbalong this path: app/controllers/admins/sessions_controller.rband it starts with:
module Admins
class SessionsController < Devise::SessionsController
If this is the controller that you want to use in your application, then in the block devise_scopeyou should tell it to use admins/sessions, and not devise/sessions, for example:
devise_scope :admin do
get 'login' => 'admins/sessions#new', :as => :new_admin_session
post 'login' => 'admins/sessions#create', :as => :admin_session
delete 'logout' => 'admins/sessions#destroy', :as => :destroy_admin_session
end
source
share