【发布时间】:2011-06-24 10:48:29
【问题描述】:
我正在 Rails 3 中构建一个多嵌套表单。我正在使用 formtastic_cocoon gem,但我认为这与这个问题没有太大关系。
我有用户,用户有任务,任务有步骤。 嵌套是用户>任务>步骤。 我可以为用户动态添加和删除任务字段,以及任务中的步骤字段。
但是,当我提交表单时,用户会收到任务,但任务>步骤不会保存到数据库中。
Rails 没有返回任何错误,只是没有任何反应。
我的模型是
类用户 proc {|attributes|属性[:entry].blank?}, :allow_destroy => true 结尾 类任务 proc {|attributes|属性[:title].blank?}, :allow_destroy => true 结尾 类步骤在我的 form.html.erb 我有
builder %>
_task_fields.html.erb 看起来像这样
builder %>
最后,_step_fields.html.erb 页面是
【问题讨论】:
标签: ruby-on-rails nested-forms formtastic