On Oct 27, 2009, at 8:28 AM, about2flip wrote:
>
> Hi:
>
> I read through the rdocs, and I saw the following:
>
> def require_password_confirmation(value = nil)
> rw_config(:require_password_confirmation, value, true)
> end
>
> def validates_length_of_password_field_options(value = nil)
> rw_config(:validates_length_of_password_field_options, value,
> {:minimum => 4, :if => :require_password?})
> end
>
> def validates_length_of_password_confirmation_field_options(value =
> nil)
> rw_config(:validates_length_of_password_confirmation_field_options,
> value, validates_length_of_password_field_options)
> end
>
> i put these into my ApplicationController, and it does not seem to be
> working. It still tells me that my password confirmation is too short.
> I am pulling out my hair.
These don't go in your ApplicationController... they go into the model
that you are applying AuthLogic on. The below would change the
minimum to 1 character.
class User < ActiveRecord::Base
acts_as_authentic do |c|
c
.merge_validates_length_of_password_confirmation_field_options
:minimum => 1
end
end
Unless you have a good reason though requiring at least 4 characters
isn't unreasonable (some would argue you should require more).
-philip
> Any help would be greatly appreciated. Also, I am on XP OS.
>
> Thanks Again
>
> On Oct 27, 8:39 am, Marnen Laibow-Koser <rails-mailing-l...@andreas-
> s.net> wrote:
>> about2flip wrote:
>>> Hi:
>>
>>> I am using authlogic, and following railscast tutorial. I am running
>>> into this error code with the password confirmation.
>>
>>> authlogic password confirmation is too short
>>
>>> Has anyone experienced this error? I need your help.
>>
>>> Thanks in advance for your help.
>>
>> Configure Authlogic with a different minimum password length (check
>> the
>> rdoc for details).
>>
>> Best,
>> --
>> Marnen Laibow-Koserhttp://www.marnen.org
>> [email protected]
>> --
>> Posted viahttp://www.ruby-forum.com/.
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---