24 Apr 2005

Geek Moment: RoR waaay cool

Posted by AC

So, I started playing around more with Ruby on Rails (RoR) recently. I’m seriously impressed. There’s an excellent tutorial available that walks you through making a todo list application via rails.

I’ve done a fair amount of CGI programming in Python. And a good bit of Java servlet application programming. Neither feels as natural as RoR. I feel like once I actually have a better handle on both the Ruby language itself, and the Rails framework, I’ll be able to pump out database-supported web applications quickly and with a minimum of fuss.

RoR does a superb job of dividing the application up into the Model/View/Control (MVC) pieces, though it’s clear that it’s up to the author to continue to maintain that distinction. For example, the main files edited during the creation of the tutorial application were:


app/models/todo.rb
app/views/todo/list.rhtml
app/controllers/todo_controller.rb

I mean, how clean is that!

I did all of this on a laptop on which I just installed Gentoo because Gentoo doesn’t have a portage package for rubygems for the sparc architecture where I’d wanted to try this out. It appears that rubygems is platform independent, but I wasn’t in a mood to go screwing with it.

I’ve set up a proxy server on my main web server so that you can go to http://ruby.accapehart.com/ which will resolve to my main server and then proxy pass that along to the laptop. (Which, is also terribly cool!) If you want to see the finished todo application from the tutorial in action.

Now, I’m off to The Server Side to check out an article comparing Rails to Hibernate. Hibernate’s a Java-based Object Relational Mapping (ORM) tool. Maybe it’s just as cool, and I can stick with Java.

Though one thing I like about Rails is how easily I can (and did) integrate it with the Apache2 web server (via fast-cgi). I know people love tomcat (the java web application framework). I’m just not one of them. It feels too big and unwieldy. I still wish there were just a simple way I could include servlets within the apache httpd. Oh well.

Geek Out

AC

Leave a Reply

You must be logged in to post a comment.