I have Users and I have Courses. I am trying to create a "Join" button for the users when they're viewing the course list in order to subscribe them to the Courses.
I was told to use
class Course extends AppModel
{
public $hasAndBelongsToMany = array('User');
}
and
class User extends AppModel
{
public $hasAndBelongsToMany = array('Course');
}
But I don't know how to implement the actual button and the posting of the info to a table called courses_users
Where do I implement this?
Thanks in advance!