你用 Sinatra 做什么? [英] What do you use Sinatra for?
问题描述
我对 Sinatra(红宝石框架)感到困惑.
Im confused about Sinatra (the ruby framework).
它是轻量级 Rails 替代品还是可以让它们并排运行?
Is it a lightweight Rails replacement or you can have them running side by side?
你能做一个 Web 应用程序吗(就像在 Rails 中一样)?例如推特克隆?
Can you do a web application (as in Rails)? For example a twitter clone?
推荐答案
Sinatra 不是 Rails.它是一个用于简单网站的微框架,您可能只需要定义一些操作.您可以根据需要使 Sinatra 应用程序变得复杂,但是您的代码会比使用 Rails 更快变得一团糟.
Sinatra is not Rails. It is a micro-framework used for simple websites where you may need to just define a few actions. You can make a Sinatra application as complex as you want to, but you'll hit a point where you code has become a crazy mess sooner than with Rails.
虽然不是 100% 准确,但 Sinatra 主要适用于页面控制器架构模式和 Rails是一个明确的 MVC 实现.
While not 100% accurate, Sinatra fits mostly into the Page Controller architectural pattern, and Rails is a clear MVC implementation.
具体回答您的问题:
- 它不打算取代 Rails
- 它可以并排运行
- 您可以在 Sinatra 中创建一个 twitter 克隆
- It is not intended to replace Rails
- It can run side by side
- You could create a twitter clone in Sinatra
这篇关于你用 Sinatra 做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!