2

我希望能够使用 Rails 的原生表单基础架构来管理嵌套关系。

Changelog引用了,accepts_nested_attributes_for但它似乎不起作用。

我可以向 ActiveNode 添加作为函数的属性并手动管理相关模型的创建吗?

4

1 回答 1

1

有趣的。我必须深入研究才能确定,但​​由于ActiveNodeuses ActiveModel,似乎设置<attribute>_attributes=方法可能会有所帮助。请参阅以下链接:

https://coderwall.com/p/kvsbfa/nested-forms-with-activemodel-model-objects

https://github.com/plataformatec/simple_form/wiki/Use-with-ActiveModel-compliant-models

我自己没有尝试过,但如果这没有帮助,那么在 repo 上打开一个问题,我们可以看看

于 2015-04-15T13:06:29.760 回答