Sunday, November 4, 2007

From PHP To Ruby

Recently the ruby-talk mailing list has had a lot of "how do I do PHP technique X in Ruby?" questions. With so many programmers coming to Rails from PHP, this will only increase in future. What we need is a guide for moving from PHP to Ruby.

I never used PHP very much, but it turns out that Alex Young already made some pages in the Rails wiki that cover exactly those questions. Here are some of the most Frequently-Asked Questions:

How do I get PHP's REQUEST_URI in Rails?
How do I move from PHP pages to Rails templates?
How do I use PHP-style associative arrays, booleans, etc., in Ruby?
How do I do PHP-style loops and if/else/etc. in Ruby?