I have a User model and a Users controller.

In the controller I have two  methods:

1) /users/signup

2). /users/edit_account

When a user signs up, the User model validates a number of fields,
including the email address field. I basically makes sure that the
email field is not blank, that it is in email format and that the
respective email is not already in the db. This works great.

However, I then display pretty much the same form for the edit account
page. The problem: because edit account is a method inside the users
controller, when clicking submit on the edit account page, this
submission gets validated by the User model, like the signup action
before.

And the validation rule which makes sure that the respective email is
not already in the db fires and invalidates the email field. As the
email address is of course in the db (the user already signed up), I
would like to be able to remove this validation rule if the submitted
form is edit account, and only keep the rule active if the submitted
form is signup.

How can I do this in Cake respecting the MVC conventions?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to