Learning the Rails
Posted by Dave on 15 Jun 2008 | Tagged as: Web Development, Work
My preferred framework for developing web applications is Ruby on Rails. Ruby on Rails is a framework built on a set of conventions for database-backed web application development that are implemented using the Ruby programming language. As open source software, it does have the benefit of being free (as is PHP), meaning savings that can be passed on to clients. However, unlike PHP, the framework has been designed from the ground up to assist in the rapid implementation of complex applications with the maximum of ease.
As a developer who generally works alone, this means I’m able to offer development of much more involved sites than I otherwise would be able to undertake on my own, whilst passing on the cost benefit of hiring a single designer/developer.
Ruby on Rails is opinionated software. That is, the designers of the framework have definite ideas about how a web application should be designed. As long as you follow the conventions laid out by the framework, you are given a huge amount of functionality for free. For example, if you follow the standard Rails naming conventions for database tables, your Ruby on Rails application will automatically understand the relationships between those tables and allow you to query them as such.
Some of the other conventions Rails has adopted include the MVC (Model, View, Controller) approach for separating your programs business logic, resource modelling and presentational views in a clean and easy to maintain manner; and the REST (REpresentation State Transfer) method for implementing a consistent and open API (Application Programming Interface) for facilitating integration from the burgeoning array of web services that make up Web 2.0.
As Rails hit version 2, it adopted REST principles as its default convention. When you use the in-built generators that get you quickly up and running with an application, REST principles are inherently enabled. As such, understanding REST and its Rails implementation has now become a whole lot more important. With the further tuning that came about with the recent release of Rails 2.1, we have a whole new bunch of features (some to do with the REST implementation, some not - such as time zone support) to learn about.
Following are the tutorials I have found most helpful in updating my knowledge of Rails to incorporate best practice REST implementation. Reading the articles (and watching the screencasts) will stand you in good stead for creating a new web application that follows the REST methodology.
This site is great whether you are entirely new to Rails, or if you simply want to update your 1.x knowledge in light of the adoption of REST in 2.x. If you are new to Rails, start at the beginning with the podcasts (lessons 1 - 8). These introduce Rails from the ground up… why you might want to use Rails, the idea of convention over configuration, DRY (Don’t Repeat Yourself) and MVC. If you’re already familiar with Rails and the aforementioned ideas, skip straight to the screencasts (lessons 9+). The screencasts comprehensively take you through building a CMS (Content Management System) website in a series of easy-to-follow lessons - despite the fact that they are describing some very powerful techniques.
Fabio Akita, a Brazilian Rails developer, always seems to be the first person to create tutorials for the latest developments in the Rails world. And indeed, his First Rails 2.0 Screencast is a perfect example. However, the lightning speed of this screencast, whilst capturing a lot of features of the new Rails, is a bit difficult to digest. Much more useful is the accompanying 2 part tutorial article he wrote to support it. Despite English being the author’s second language, this really is an easily understandable article (assuming you are familiar with Rails 1.x), and is the best practice of RESTful Rails that I have come across yet.
A useful follow-up to this article, is the 2 part article he wrote on the new additions in Rails 2.1.
Whether you are interesting in learning Rails yourself, are simply interested in finding out what all the hype is about, or if you are a business that has come across Rails development as an option and would like to know more about it, I hope this post has been of help. If you have any further questions about Ruby on Rails development, such as how it might be useful to you in your business, please get in contact with me.
Many thanks to the authors of the articles mentioned in this post.

[...] information on the open source Ruby on Rails framework and how it can help your business, see my previous post on the subject or get in contact with [...]