Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development.[1]History
Ruby on Rails was extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by 37signals (now a web application company).[2] Heinemeier Hansson first released Rails as open source in July 2004, but did not share commit rights to the project until February 2005.[3] In August 2006 the framework reached a milestone when Apple announced that it would ship Ruby on Rails with Mac OS X v10.5 “Leopard”,[4] which was released in October 2007.
[edit] Technical overview
Like many web frameworks, Rails uses the Model-View-Controller (MVC) architecture pattern to organize application programming.[5]
Ruby on Rails includes tools that make common development tasks easier “out of the box”, such as scaffolding that can automatically construct some of the models and views needed for a basic website.[6] Also included are WEBrick, a simple ruby web server, and Rake, a build system. Together with Rails these tools provide a basic development environment.
Ruby on Rails relies on a web server to run it. Mongrel was generally preferred over WEBrick at the time of writing[citation needed] but it can also be run by Lighttpd, Abyss, Apache (either as a module – Passenger for example – or via CGI, FastCGI or mod_ruby), and many others. From 2008 onwards, the Passenger web server replaced Mongrel as the most used web server.[citation needed] Recently, the Unicorn web server has become a favorite of new deployments.[citation needed]
Rails is also noteworthy for its extensive use of the JavaScript libraries Prototype and Script. aculo. us for Ajax.[7] Rails initially utilized lightweight SOAP for web services; this was later replaced by
RESTful web services.
Since version 2.0, Ruby on Rails by default offers both HTML and XML as output formats. The latter is the facility for RESTful web services.
Ruby on Rails relies on Ruby 1.8.6. The upcoming 3.0 version will drop support for Ruby 1.8.6 and require Ruby 1.8.7 to work[8].
[edit] Framework structure
Ruby on Rails is separated into various packages, namely ActiveRecord (an object-relational mapping system for database access), ActiveResource (provides web services), ActionPack, ActiveSupport and ActionMailer. Prior to version 2.0, Rails also included the Action Web Service package that is now replaced by Active Resource. Apart from standard packages, developers can make plugins to extend existing packages.
[edit] Philosophy and design
Ruby on Rails is intended to emphasize Convention over Configuration (CoC), and the rapid development principle of Don’t Repeat Yourself (DRY).
“Convention over Configuration” means a developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table “products sold”, that the developer needs to write code regarding these names. Generally, this leads to less code and less repetition.
“Don’t repeat yourself” means that information is located in a single, unambiguous place. For example, using the ActiveRecord module of Rails, the developer does not need to specify database column names in class definitions.