double Accepts_nested_attributes_for

发布于 2024-08-29 08:52:05 字数 195 浏览 5 评论 0原文

有谁知道是否可以为其做双重嵌套形式。这样我就可以从文章表单将图像上传到一组。

例如

Article
  has_many :image_sets

ImageSet
  belongs_to :article
  has_many :images

Image
  belongs_to :image_set

does anyone know if it is possible to do a double nested form for. so that i could upload images to a set from an article form.

e.g.

Article
  has_many :image_sets

ImageSet
  belongs_to :article
  has_many :images

Image
  belongs_to :image_set

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘和柠 2024-09-05 08:52:05

查看 Railscasts #196,看起来他设置了两个嵌套属性的级别,也许你可以做类似的事情。

Check out Railscasts #196, looks like he sets up two levels of nested attributes, maybe you can do something similar to that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文