In the web application I'm building a user has a profile where they can list their skills. I would like the kind of functionality StackOverflow has when making posts, where you can type tags into the tag input and select ones that already exist, and create them if they don't already exist.
At the moment, I've got a select box appearing on the page with with the id
of the users current skills as values. I'm achieving this by doing:
// ProfilesController.php
$skills = $this->Profile->ProfilesSkill->find('list');
// edit.ctp
<?php echo $this->Form->input('Skill', array('value' => $skills)); ?>
I've got no idea how to progress further, though. First of all, the name
field for the skills should be shown instead of their id
, which I'm confused about because by Cake's convention it will use the name
field by default, even though it's not. And secondly when I enter my skills into my profile Cake should automatically make all the required entries in the profiles_skills
table. How can I make that work?