我只需要 ActiveRecord 和 ActiveMailer,我应该使用 Rails/Merb 吗?
我有一个小型 Web 应用程序,当前正在 Sinatra 上运行。 它只有两个页面,所以我实际上不需要控制器或很多视图。 我已经包含了 ActiveRecord 来与数据库交互,并包含 ActiveMailer 来发送和接收邮件。
在这么小的项目上使用 Rails 或 Merb 值得吗? 我发现自己添加了 Rails 中包含的功能。 我以前没有使用 Merb 的经验,所以我真的不知道这是否是一个合适的选择。 但据我所知,Merb 可能是进行只需要几个组件的项目的方法。
谢谢。
I have a small web application that is currently running on Sinatra. It only has two pages so I don't really need controllers or many views. I have included ActiveRecord to interact with a database and ActiveMailer to send and receive mail.
Would it be worth it to use Rails, or Merb on a project as small as this? I find myself adding features that are included in Rails. I haven't had any experience with Merb before so I don't really know if that would be a suitable option. But from what I hear Merb may be the way to go on a project that only needs a few components.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您已经在 Sinatra 上运行一个小项目,则无需切换到 Rails。 您可以在 Rails 之外使用 ActiveRecord 和 ActiveMailer。
No need to switch to Rails if your already running on Sinatra for a small project. You can use ActiveRecord and ActiveMailer outside of Rails.
Merb 正在与 Rails for Rails 3.0 版本合并。 作为此过程的一部分,核心 Rails 架构将被“merbified”,以便更轻松地配置为仅使用您需要的特定组件。
随着您的应用程序的增长,您可能会发现自己正在重新发明已经存在的功能,在这种情况下,我会考虑切换框架。
就我个人而言,即使是非常小的项目,我也会使用 Rails。 这意味着我对我所做的一切工作都有一个单一的框架和部署环境。
Merb is merging with Rails for Rails version 3.0. As part of this process, the core Rails architecture is going to be "merbified" so as to be more easily configured to only use the particular components you need.
There may going to be a point as your application grows that you find yourself reinventing features that already exists, in this case I would consider switching frameworks.
Personally, I use Rails even for quite small projects. It means I have a single framework and deployment environment for everything that I work on.
我经常使用 Sinatra 来处理比你描述的更大的事情。 您发现需要添加 Rails 的哪些功能? 如果只是像
5.hours.ago
这样的东西,您始终可以:a) 将这部分代码从 activesupport 中取出,并将其粘贴到项目中的“通用”/类似文件中,或者b) 只需要主动支持并使用它的功能。I use Sinatra often for stuff much bigger than what you describe. What features of Rails do you find you are needing to add? If it's just stuff like
5.hours.ago
and stuff, you could always: a) pull that part of the code out of activesupport and paste it into a 'common'/similar file in your project or b) just require activesupport and use it's features.