Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 告诉AuthLogic不要使用密码确认_Ruby On Rails_Authlogic_User Experience_Password Confirmation - Fatal编程技术网

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

Ruby on rails 告诉AuthLogic不要使用密码确认,ruby-on-rails,authlogic,user-experience,password-confirmation,Ruby On Rails,Authlogic,User Experience,Password Confirmation,我有这样的看法: new.html.haml _form.html.haml 导致此错误消息: 1错误禁止保存此用户 以下字段存在问题: 密码确认太短(最少4个字符) 我不需要密码确认。密码确认很糟糕,它们阻止了超快注册,这太棒了!有人能告诉我如何禁用密码确认吗?谢谢。试试这个: class User < ActiveRecord::Base acts_as_authentic do |c| c.require_password_confirmation = false

我有这样的看法:

new.html.haml _form.html.haml 导致此错误消息:

1错误禁止保存此用户 以下字段存在问题:

  • 密码确认太短(最少4个字符)
我不需要密码确认。密码确认很糟糕,它们阻止了超快注册,这太棒了!有人能告诉我如何禁用密码确认吗?谢谢。

试试这个:

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

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

Harish,我们是否可以仅在特定情况下禁用密码确认?以下是我的问题。你能回答这个问题吗
= form.label :email
= form.text_field :email
%br/
= form.label :password, form.object.new_record? ? nil : "Change password"
= form.password_field :password
class User < ActiveRecord::Base
  acts_as_authentic do |c|
    c.require_password_confirmation = false
  end
end