Rails 3 正在移除 Metal 吗?

发布于 2024-10-05 08:31:58 字数 683 浏览 1 评论 0原文

Rails 3 正在移除 Metal 吗?

我正在尝试实现 Mongoid、Carrierwave 和 grid_fs。

我已遵循指南 1

但是,我读到 Rails 3 正在删除 Metal ( http://github.com/rails/rails /commit/ed34652d1aca148fea61c5309c1bd5ff3a55abfa )。

所以我偶然发现了这篇文章: 指南 2

考虑到 Rails 3 可能会删除 Metal 并用于将来的维护。哪个指南更适合让 grid_fs、Mongoid 和 Carrierwave 一起工作?

Is Rails 3 removing Metal?

I am trying to implement Mongoid, Carrierwave and grid_fs.

I have followed guide 1.

However, I have read that Rails 3 is removing Metal ( http://github.com/rails/rails/commit/ed34652d1aca148fea61c5309c1bd5ff3a55abfa ).

So I stumbled across this article instead: guide 2

Given the circumstances that Rails 3 may be removing Metal and for future maintenance. Which guide is more suitable to get grid_fs, Mongoid and Carrierwave all working together?

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

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

发布评论

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

评论(1

傾旎 2024-10-12 08:31:58

您注意到带有注释“Removing Metal from Rails 3”的提交。然而,所发生的事情实际上与这句话完全相反!

Rails 3 没有移除金属。恰恰相反。现在,所有控制器都是金属,仅具有您要求的附加功能。您需要做的就是从 ActionController::Metal 继承您的特定控制器类,然后包含提供您想要在该特定控制器中提供的附加功能的任何特定模块。

当然,大多数人都会从 ActionController::Base 继承他们的控制器。但现在,ActionController::Base 仅继承 ActionController::Metal 并包含所有附加功能模块。

您注意到的那个提交正在将金属作为一个单独功能删除,与ActionPack的其余部分分开。现在,金属不再是一个单独功能,因此金属的单独功能实现被删除。现在,一切都是金属。

You noticed a commit with the comment "Removing Metal from Rails 3." However, what is going on is actually quite the opposite of that phrase!

Rails 3 did not remove metal. Quite the opposite. Now, all controllers are metals, with only those additional features that you request. All you need to do is inherit your particular controller class from ActionController::Metal, and then include any particular modules that provide the additional features you want in that particular controller.

Of course, most people will inherit their controllers from ActionController::Base. But now, ActionController::Base merely inherits ActionController::Metal and includes all of the additional feature modules.

That commit you noticed is removing metals as a separate feature, apart from the rest of ActionPack. Now, metals are no longer a separate feature, so the separate feature implementation of metals was removed. Now, everything is a metal.

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