If you only want to validate when the record is first created, you can
add:
:on => :create
to your helper, like this:
validates_presence_of :password, :on => :create
On subsequent record updates that validation will not be called.
/afb
Pete C. wrote:> hey,
> I do some validation in my user.rb file when a user signing up
> validates_presence_of :password
>
> now, when the user want to edit its account, I dont want that the
> password is checked anymore - how can I do that?
>
> I need the validation only in the signup process but not in the account
> editing process?
>
> pete
--
Posted via http://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---