0

I have two models user and admin configured with devise gem. I get exception when apply authentication in admin controller.

before_action :authenticate_admin!

error:

undefined local variable or method `authenticate_admin!' 

Admin Model:

class Admin < ActiveRecord::Base
  devise  :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :confirmable,:invitable
 end

Patient Model:

class Patient < ActiveRecord::Base
  devise  :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :confirmable,:invitable
 end

Routes:

    devise_for :admins
    namespace :hospitals do
      devise_for :patients
end
Sivakumar
  • 1,089
  • 1
  • 13
  • 24

0 Answers0