What is the simplest way to display validation errors for hasMany associations using Model::saveAssociated() in CakePHP 2.x?
Here is an example from the CakePHP cook book. (http://book.cakephp.org/2.0/en/models/saving-your-data.html#saving-related-model-data-hasone-hasmany-belongsto)
echo $this->Form->create('Company', array('action' => 'add'));
echo $this->Form->input('Company.name', array('label' => 'Company name'));
echo $this->Form->input('Company.description');
echo $this->Form->input('Company.location');
echo $this->Form->input('Account.0.name', array('label' => 'Account name'));
echo $this->Form->input('Account.0.username');
echo $this->Form->input('Account.0.email');
echo $this->Form->end('Add');
When validation, for example, for Account.0.email fails the form field doesn't appear to be automatically invalidated. Although the error is listed in $this->Company->Account->validationErrors.
Is there a way to automatically invalidate the appropriate field and display the corresponding validation error?