在我的项目中,我想使用带有STI的Devise。我的课程看起来像这样:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :invitable, :database_authenticatable, :registerable, #:confirmable,
:recoverable, :rememberable, :trackable, :validatable
end
class Administrator < User
end
在我的路线中,我有:
devise_for :administrators
当我访问/ administrators / sign_up或/ administrators / sign_in时,它会返回以下错误:
wrong number of arguments (2 for 1)
block (2 levels) in Warden::SessionSerializer#administrator_deserialize
devise (3.5.6) lib/devise.rb, line 464
答案 0 :(得分:0)
devise_for :administrators, skip: :sessions #should resolve the issue