I am trying to allow a user to answer some questions and then save those
questions but I am unsure if I am getting the layout correct. Here is
what I have so far:
There is a questions table holding the questions to ask
There is an answers tables which holds the answers to the questions
asked of a user.
Then there is of course the Users table which hold a variety of user
I figure my migrations would look something like:
Questions: has_many :answers
Answers: belong_to :user, belongs_to :question
User has_many :answers
so my table would look like:
User: id, username, . . .
Questions: id, question
Answer: id, user_id, question_id, answer
Where I am a little confused is if the belongs_to :question should
rather be a has_one :question and would that change the schema at all?
Also, can anyone point me to some good online tutorials involving Model