I need to check for password confirmation in a form using the method validates_confirmation_of on both create and update procedures. So we have :on option where we can specify :on => :save. But, it is simply not working. It is working fine only when I specify :on => :create, :on => :update separately on a validation method which doesn’t follow DRY aspect of rails. Please help.
Thank you.
if you want to validate on both create and update, then you should not specify :on => :save, the validation is for both create and update by default.
if you want to validate only on create or only on update, then only you should specify :on => :create or :on => :update