Problems with nested form fields showing up

…衆ロ難τιáo~ 提交于 2019-12-03 23:07:09

What is going on in your controller? I haven't read the tutorial yet, and can't seem to pull it up right now (down?) but are you building out an object in memory to fill out?

in your controller, in your "new" action, make sure that you are

@instruction = Instruction.new
@instruction.steps.build

This will instantiate a Step in memory as a "placeholder" for your form to fill in . . . at least this is what I do in my own controller when using a accepts_nested_attributes_for, and it works great.

Let me know if it works, and once I can pull up the tutorial I may have to edit this

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!