class Producer extends ActiveRecord{
var $belons_to = 'organization';
}
class Organization extends ActiveRecord{
var $has_many = 'producers';
}
Then in your controller you can just do.
class ProducerController extends ApplicationController{}
var $moels = 'Producer,Organization';
function add()
{
if(!empty($this->params['producer'])){
$this->Producer->setAttributes($this->params['producer']);
if ($this->Request->isPost() && $this->Producer->save() &&
$this->Producer->organization->set($this-
>Organization->find($this->params['organization_id'])) ){
$this->flash['notice'] = $this->t('Producer was
successfully created.');
$this->redirectTo(array('action' => 'show', 'id' =>
$this->producer->getId()));
}
}
}
Bermi