gpt4 book ai didi

ruby-on-rails - Wicked gem Rails - 如何创建一个新对象

转载 作者:行者123 更新时间:2023-12-04 03:39:03 24 4
gpt4 key购买 nike

Building Partial Objects Step by Step Wicked Gem Wiki 上的页面解释了如何使用 wicked 逐步创建对象.

但是我要如何创建一个新的Product目的?

我必须在 ProductsController 中的新操作中这样做吗? ?
我必须重定向到哪里?

最佳答案

Building Partial Objects Step by Step 中给出了以下语句页。
This also means to get to the create action we don't have a product_id yet so we can either create this object in another controller and redirect to the wizard, or we can use a route with a placeholder product_id such as [POST] /products/building/build in order to hit this create action.
您可以在另一个 Controller 中创建对象并重定向到向导或使用带有占位符的路由来点击创建操作。

关于ruby-on-rails - Wicked gem Rails - 如何创建一个新对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14662279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com