Validation help

Adrian Madrid
Wed, 07 Sep 2005 17:38:51 -0000

What is the best way to validate a field NOT to be the same as another
field? I tried doing this unsuccesfully. Any ideas would be apreciated.

validates_each :fieldx do |record, attr|
    record.errors.add attr, ''must be different from fieldy'' if
attr ==
fieldy
end

Thanks in advance,