I have a class persons and a class subjects. at the moment they are not connected at all. As a user one can only chose subjects from a list and inspect them. Now I'd like to allow users to assign to subjects, thus the user class needs a list where it can store its subjects. ... and a table which maps subjects to persons.. (m to n)
I have not much experience with Ruby on Rails and I am afraid to destroy my application when trying to do this.
So far I found out that there are commands to do that (sth. like $ rails generate migration AddSubjectsToPersons
), but I can't find out what they do exactly, e.g.if it touches my model or controller classes..
In case that yes - is there something removed I wrote before?, if not - is it enough to add a field (a list) called lessons to my model and the connection to the db will be detected automatically?