📜  devise first_name 不是空白时不能为空 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:28.403000             🧑  作者: Mango

代码示例1
#You need to add them to the strong params for the devise controller.
 #You can create your own (Which extend Devise) and then:
 
 class RegistrationsController < Devise::RegistrationsController

 private

 def sign_up_params
   params.require(:user).permit(:first_name, :last_name, :email, :password, 
   :password_confirmation)
 end

 def account_update_params
   params.require(:user).permit(:first_name, :last_name, :email, :password, 
   :password_confirmation, :current_password)
 end
 end