0
このリンクに続くユーザーのパスワードを変更したいと考えています:Allow-users-to-edit-their-password。私は確認メールを避けるためにをuser
に追加しましたが、動作しません。 は、ここに私のコードです:更新についてDeviseユーザー#skip_confirmation_notification!動作しません
def update_password
@user = User.find(params[:id])
@user.skip_confirmation_notification!
if @user.update(user_password_params)
flash.notice = 'Password was successfully updated.'
else
flash.alert = @user.errors.full_messages.join('<br/>')
end
render "show_update_password"
end
private
def user_password_params
params.require(:user).permit(:password, :password_confirmation)
end