更新时间:2023-11-24 10:32:16
你弄错了:= q.simple_fields_for :answers, q.questions.build do |a|
您在构建器对象 q
而不是模型对象上调用 questions
方法.可能你想要这个:
You got it wrong here: = q.simple_fields_for :answers, q.questions.build do |a|
You are calling questions
method on builder object q
instead of a model object.
Probably You want this:
= q.simple_fields_for :answers, q.object.questions.build