views:

131

answers:

1

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

Resulting in this evil error message:

1 error prohibited this user from being saved

There were problems with the following fields:

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

I don't want a password confirmation. Password confirmations suck and they prevent super-fast signing up, which is awesome! Can anyone explain me how to disable the password confirmation? Thanks.

+3  A: 

Try this:

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

Refer to the documentation for more details.

KandadaBoggu