Hi all, I am currently doing work on my rails project and have hit a
wall. I am quite new to Rails so at the moment only know a little bit
I have a users table and a games table. At the moment I am able to enter
in user information as well as add new games to the games table.
What I wish to do now is to combine the both using a foreign key. I have
added the user_id entry to the games table and even declared it as a
foreign key by writing it as a command through MySQL. I have also
declared them as followed:
model Games < ActiveRecord::Base
model User < ActiveRecord::Base
Is there anything else I must do. I want to be able to on the user
profile show all games associated with that particular user. How would I
go about doing this?
Any help would be greatly appreciated.