Post by Peter Cooper on August 27th, 2006
The ease of PHP with the power of Ruby

- Pre-processing / normalizing parameters in Rails
- HAML: A new view template language for Rails
- Haml 1.7 Released: Now 16 Times Faster Than Markaby


#!/usr/bin/ruby require 'rubyhp' __END__ <html> <body> <% cgi.params.each do |key, value| %> <%= key %>: <%= value %><br /> <% end %> <% if cgi.params.empty? %> Sorry, please enter some cgi parameters. How about "?foo=baz"? <% end %> </body> </html>
Christopher Cyll has put together a great little example of how to quickly create templated Web pages with Ruby without requiring any frameworks. It relies on CGI, but sometimes that's all you need, and it makes throwing together tiny Ruby-powered Web pages possible as easy as creating a simple PHP page.

Click here to add on del.icio.us









August 28th, 2006 at 3:38 am
What about:
http://www.hiveminds.co.uk/node/3105
It is a little bit more elaborated, but almost the same. And I agree with you, not everything is a "application" there is a lot of space for quick n' dirty small scripts
August 28th, 2006 at 5:22 pm
A slightly better way:
http://termos.vemod.net/making-ruby-into-php-take-two
August 28th, 2006 at 8:40 pm
One of the things I like about Ruby's Nitro Web framework is that it makes it very easy to build dirt-simple, ASP/PHP-like pages, while providing a good migration path to more a sophisticated ORM/MVC-style architecture if you need that as the application evolves.
http://nitroproject.org/