Im trying to establish relationships in a many to many table.
When I create a user, I do this to insert the different relationships
between the user and sports:
c.sports<<Sport.find_all_by_name(params[:sports])
where c is the user. The problem is, when I edit this user, and lets say
he adds a sport, I can’t use this because I get an error saying that
some records already exist since its not only adding the new records but
also all the old records again.
What is the best way to do an updating like this is rails?
Should I just delete all the records associated with the user and add
them in again?