validates_presence_of - only on edit

Ok so not sure if this is possible but it would help out a lot if it is. I am trying to put this validation on one of my forms

validates_presence_of :name, :state

however I only need this validation to run when they edit this form, not when they create it. is this possible, any suggestions would be greatly appreciated. thanks in advance.

Ok so not sure if this is possible but it would help out a lot if it is. I am trying to put this validation on one of my forms

validates_presence_of :name, :state

however I only need this validation to run when they edit this form, not when they create it. is this possible, any suggestions would be greatly appreciated. thanks in advance.

Check the docs... it's in there.

# on - Specifies when this validation is active (default is :save, other options :create, :update).

validates_presence_of :name, :state, :on => :update

-philip

hey thanks that was the trick, much appreciated

hey thanks that was the trick, much appreciated