I am trying to implement nested_form for creating response of a survey. So survey has questions and response generate form should have nested attributes already build in controller. I am using following code.
@survey = Survey.friendly.find(params[:survey_id])
@response = @survey.responses.build
@survey.questions.each do |question|
@response.response_details.build(question_id: question.id)
end
I am trying to implement nested_form for creating response of a survey. So survey has questions and response generate form should have nested attributes already build in controller. I am using following code.
In my form
I am getting following error