Hi!
I have two models questions and questionresponses, which is dependent on questions. I am not sure whether to use questionsrespones or question_responses, for example, in the build statement in the controller:
@questionresponse = @question.question_responses.build(params[:questionresponse])
Thanks!
Hi!
I have two models questions and questionresponses, which is dependent on
questions. I am not sure whether to use questionsrespones or
question_responses, for example, in the build statement in the controller:
The models should probably be Question and QuestionResponse. The
capitalisation is important. Then the tables are questions and
question_responses.
Assuming that you have Question has_many :question_responses and
QuestionResponse belongs_to :question then the relationships are also
named question and question_response.
Colin
Thank you for your response.