Tell AuthLogic not to use password confirmation

I have this view:

new.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 

The result of this incorrect error message:

1 error prevented the user from saving

There were problems with the following fields:

  • Password confirmation too short (minimum 4 characters)

I do not want password confirmation. Password confirmations suck and they prevent super-fast registration, which is awesome! Can someone explain to me how to disable password confirmation? Thanks.

+4
source share
1 answer

Try the following:

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

See more details.

+12
source

Source: https://habr.com/ru/post/1316076/


All Articles