gpt4 book ai didi

ruby-on-rails - 告诉 AuthLogic 不要使用密码确认

转载 作者:行者123 更新时间:2023-12-04 22:25:29 24 4
gpt4 key购买 nike

我有这样的看法:
新的.html.haml

%h1 New account

- form_for @user do |f|
= f.error_messages
= render :partial => "form", :object => f
= f.submit "Create account"
_form.html.haml
= form.label :email
= form.text_field :email
%br/
= form.label :password, form.object.new_record? ? nil : "Change password"
= form.password_field :password
导致这个邪恶的错误信息:

1 error prohibited this user from being saved

There were problems with the following fields:

  • Password confirmation is too short (minimum is 4 characters)

我不想要密码确认。密码确认很糟糕,它们阻止了超快速注册,这太棒了!谁能解释我如何禁用密码确认?谢谢。

最佳答案

试试这个:

class User < ActiveRecord::Base
acts_as_authentic do |c|
c.require_password_confirmation = false
end
end

有关更多详细信息,请参阅 documentation

关于ruby-on-rails - 告诉 AuthLogic 不要使用密码确认,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3275856/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com