控制器定义中的脚手架不再有效吗?

发布于 2024-07-18 21:25:15 字数 319 浏览 4 评论 0原文

class AdminController < ApplicationController

  scaffold :album

end

在 Rails 1.1.6 教程中,我被指示将代码“scaffold :album”放入我的管理控制器中。 这是一个音乐应用程序,包含一个名为“Album”的模型。

这会生成一个错误,指出脚手架不是有效的方法

这是最新版本的 Rails 中已弃用/过时的语法吗?

我期望这能为我的专辑模型生成所有合适的通用 CRUD 脚手架。

class AdminController < ApplicationController

  scaffold :album

end

In a Rails 1.1.6 tutorial I was instructed to put the code "scaffold :album" inside my admin controller. This is a music application containing a model called "Album".

This generated an error saying that scaffold is not a valid method.

Is this a deprecated/obsolete syntax in the more recent versions of Rails?

I was expecting this to generate all of the appropriate generic CRUD scaffolding for my Album Model.

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

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

发布评论

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

评论(1

空城缀染半城烟沙 2024-07-25 21:25:15

scaffold 方法在 Rails 2 中已被弃用。请参阅 为什么 Ruby on Rails 不推荐使用脚手架方法

The scaffold method was deprecated in Rails 2. See Why did Ruby on Rails deprecate the scaffold method

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