Update HABTM

Hey guys I am new to rails and was wondering how you update HABTM tables. I have a join table called platforms and another table called games. They are joined with the table games_platforms.

I have a view that creates a multi-select pick list of all the various platforms. I figured out how to repopulate the picklist with the correct items stored in my join table but I don't know how to update them. Currently, I have a params[:games] that has the input from the list and I know the game courtesy of the params[:id]. Any help would be greatly appreciated it. Thanks.