that line creates the record in the join-table. maybe the parameters aren't right. you could 'var_dump-debug'.
$options['foreign_key']
$object_id
$options['association_foreign_key']
$AssociatedItem->getId()
could be anything. probably just the configuration of the habtm.
the first version of your ->select()-statement works for 1-1 relations.
select('event','category_id') means event has a property category_id which it hasnt.
as fourth argument you pass $Event->categories which is the right direction. this argument takes
array('selected'=>array_of_selected_values)
puttin' it together
$selected_categories = array_keys($Event->category->associated_ids);
$form_options_helper->select('event', 'category_id',
$Category->collect($Category->find(), 'category_name', 'id'),
array('selected'=>$selected_categories),array('multiple'=>'true'));
~
1 to 6 of 6