There''s a validation in the core that does precisely that:
validates_confirmation_of:
http://api.rubyonrails.com/classes/ActiveRecord/Validations/
ClassMethods.html#M000653
for custom validations use validates_each:
http://api.rubyonrails.com/classes/ActiveRecord/Validations/
ClassMethods.html#M000652
hth,
Stephen
On Nov 26, 2005, at 1:27 PM, Adam Denenberg wrote:
> Hello,
>
> is there a way to add a custom validation inside the model ?
>
> like
>
> validates_passwords_are_equal :password, :password_confirm
>
> that would make sure the password and password_confirm fields are
> the same ?
>
> thanks
> adam
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails