Rails 引擎与机架应用

发布于 2024-12-28 22:35:32 字数 293 浏览 2 评论 0原文

我正在考虑编写一个“附加”应用程序并将其作为 gem 发布。但是,我不确定是否应该编写 Rails 引擎或 Rack 应用程序。有什么区别以及我应该选择哪个?

更新:该应用程序的想法有点像“建议箱”。您的用户(或同事)可以提交改进您的应用程序的建议。然后,当您准备好开发一项新功能时,您可以附加一个 Cucumber 测试(或指向一个测试的位置),以便提交者可以看到该功能何时完成(测试通过)。因此,理想情况下,您可以将此应用程序安装在 /suggestions 或任何位置并获得所有这些功能。

I'm thinking about writing an "add-on" application and releasing it as a gem. However, I'm not sure if I should be writing a Rails Engine or a Rack application. What are the differences and which should I choose?

Update: The idea for the application is sort of like a "suggestion box". Your users (or co-workers) can submit suggestions for improvements to your application. Then, when you're ready to work on a new feature, you can attach a cucumber test (or point to the location of one) so the submitter can see when the feature has been completed (tests passing). So ideally, you could mount this application at /suggestions or where ever and get all this functionality.

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

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

发布评论

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

评论(1

残疾 2025-01-04 22:35:32

使用 Rails Engine,您通常可以使用 Rails 的强大功能,因为 Rails,它本质上是一个机架应用程序。

一般来说,与 Rails 相比,机架应用程序会有很多更少(或更多)的花哨功能。您必须确定要使用哪些 Rack 组件以及如何设置中间件(如果需要)。

如果您需要快速且易于测试的解决方案,请选择 Rails Engines。

否则,与 Rails 引擎相比,构建机架应用程序将更加有趣。

With Rails Engine, you generally have the power of Rails at your disposal, It is inherently a Rack Application because of Rails.

Generally a Rack Application will have a lot of less(or more) bells and whistles compared to Rails. You will have to figure which Rack components to use and how to setup the middleware if needed.

If you need a quick and easily testable solution, go for Rails Engines.

Otherwise building a Rack Application will be supremely more fun as compared to a Rails Engine.

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