是否有使用PHPish的方式与Ruby一起制作网页? [英] Is there a PHPish way of doing webpages with Ruby?

查看:68
本文介绍了是否有使用PHPish的方式与Ruby一起制作网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有框架或其他工具,以便可以像使用PHP一样使用Ruby开发网页.像

Is there a framework or something out there so that I can develop webpages in Ruby the same way I can as PHP. Something like

<html><head></head><body>
<?ruby
  puts '<p> Hello there!</p>'
?>
</body></html>

我看到的在网页中使用Ruby的唯一一件事就是庞大的复杂框架,它与PHP的工作方式完全不同.我的意思是,对于3层模型等来说,当然一切都很好,但是当您只想在网页中完成一些简单的事情(在PHP中是微不足道的)时,设置如此大的框架似乎并不正确.尤其是当您只想要1个用Ruby创建的页面,而其余的只是纯HTML时.

The only thing I'm seeing for using Ruby in webpages is huge complex frameworks that is completely different from how PHP works. I mean, sure that's all fine and dandy with the 3 tier model and such but when your just wanting a few simple things done(which are trivial in PHP) in a webpage, to setup such a large framework just doesn't seem right. Especially when you only really want like 1 page made in Ruby and the rest being plain HTML.

推荐答案

两个词: Sinatra ERB

(至少对于轻量级网站).

(For lightweight sites, at least).

Sinatra是一个简单的HTTP服务器,ERB是一个模板系统,其行为类似于PHP中的模板.

Sinatra is a simple HTTP server, ERB is a templating system that acts similar to templating in PHP.

这篇关于是否有使用PHPish的方式与Ruby一起制作网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆