I have a many-to-one relationship, let's pretend it's many Leafs to Trees. Of course, I baked a form to add a Leaf to a Tree, and you can specify which Tree it is with a drop-down box ( tag) created by the form helper.
The only thing is, the SELECT box always defaults to Tree #1, but I would like it to default to the Tree it's being added to:
For example, calling
You should never use
radio() etc.; it's terrible practice. You should use
$form->input('tree_id', array('options' => $trees));
Then in the controller:
$this->data['Leaf']['tree_id'] = $id;