Accessing individual HABTM records in a form
- by Pichan
I'm building a form in my CakePHP project that lets you edit a company's information. Among all other things, every company has at least one geographical area in which the company operates, but it may have more. The areas are selected individually using select dropdowns.
The relationship between companies and areas is HABTM, because I need to be able to change the amount of associated areas without modifying the database.
Currently the associations and corresponding data are handled separately, which isn't really a problem but I was wondering how it could be done using as much Cake's own 'automagic' functionality as possible?