Extra step 1 creating a many to many relationship - Thewessen/tic-tac-toe_ruby_backend GitHub Wiki

Comming from Laravel I knew some details about a many to many relationship. Being really enthousiast about the Ruby framework, I wouldn't be suprised the framework has all the tools working with it.

Emberjs has some tools working with relationships aswhell, which I wanted to utilize.

Creating the database needed for this relationship in Ruby was very easy. You can just make a migration file called games_nicknames (I believe the name matters, but I didn't tested it so I'm not sure). Set the right foreign keys by calling t.belongs_to, and you are done! Updating the models for games and nicknames with a has_and_belongs_to_many line and you are done. So nice! So intuitive!

I immediatle created a seed for the nicknames database with some initial names. I just wrote something without looking some artikel on the internet first, and it works first try. So easy!

⚠️ **GitHub.com Fallback** ⚠️