Well, you have to handle if the model doesn't save - for example if it
does not pass validation. The usual method for saving like this is:
if($this->Worker->save($this->data)) {
$this->Session->setFlash('The Worker has been saved');
$this->redirect('/workers/index');
} else {
// could not save for some reason
$this->log( $this->Worker->validationErrors );
$this->Session->setFlash('Please correct errors below.');
$this->render();
}
ignoring the difference of using setFlash and redirect vs just flash().
The log of the validationErrors will show you which fields are failing
validation.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---