再生脚手架

发布于 2024-07-09 10:54:08 字数 29 浏览 6 评论 0原文

有什么方法可以从新更新的模型重新生成视图吗?

Is there any way to re-generate views from newly updated model?

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

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

发布评论

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

评论(3

一梦等七年七年为一梦 2024-07-16 10:54:08

除非您对脚手架进行了大量更改,否则覆盖当前脚手架可能会更容易:

./script/generate -f scaffold Model

Unless you've made a lot of changes to the scaffold, it's probably easier just to overwrite the current scaffold:

./script/generate -f scaffold Model
挽梦忆笙歌 2024-07-16 10:54:08

我有同样的需求,我只是备份了一些更改并进行了销毁/生成,小心,销毁删除与模型相关的所有内容

rails destroyscaffold Model -f

在我再次生成之前。

rails生成脚手架模型

I had the same need, I just backed up some changes and did a destroy/generate, Take care, destroy deletes Everything related to the Model :

rails destroy scaffold Model -f

before I generate again.

rails generate scaffold Model

一个人练习一个人 2024-07-16 10:54:08

脚手架并不是为了创建接口,只是为了为进一步的开发提供一个起点。 我不确定是否有可能(没有很多不必要的工作)重做脚手架,无论如何手动编辑视图和控制器要快得多。

The scaffold is not intended to create the interface, only to make a starting point for further development. I'm not sure it's even possible (without a lot of unnecessary work) to redo a scaffold, it's much quicker to manually edit the view and controller anyway.

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