Hi there,

  I have my admin_add (and edit) views/actions for a model that also
allow the creation/editing of an associated HABTM model. I would like
to validate the HABTM model at the same time as the 'main' model, is
this possible? In fact, I would like an instance of the HABTM model
has been selected.

  Basically what I have is a model we can call Content, that has a
HABTM relationship with another we can call ContentFile (which is a
previously uploaded image). My Content add/edit views feature an image
selector, that displays a tree of images that have been added to the
system. I want to ensure that the user has selected one.

  Ideally I'd like

$this->Content->save

to fail (because the data doesn't validate) if no value has been
assigned to

$this->data['ContentFile'][0]['content_file_id']

(the foreign key in the HABTM relationship).

  Any recommendations?

  Thanks,

Toby
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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