27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 CHAPTER 1 Ruby on Rails, the framework<br />

1.1 What is Ruby on Rails?<br />

Ruby on Rails is a framework built on the Ruby language, hence the name Ruby on<br />

Rails. The Ruby language was created back in 1993 by Yukihiro “Matz” Matsumuto of<br />

Japan. Ruby was released to the general public in 1995. Since then, it has earned both<br />

a reputation and an enthusiastic following for its clean design, elegant syntax, and<br />

wide selection of tools available in the standard library and via a package management<br />

system called RubyGems. It also has a worldwide community and many active contributors<br />

constantly improving the language and the ecosystem around it.<br />

Ruby on Rails was created in 2004 by David Heinemeier Hansson during the development<br />

of 37signals’ flagship product: Basecamp. When Rails was needed for other<br />

37signals projects, the team extracted the Rails code from it, crafted the beginnings of<br />

the framework, and released it as open source under the MIT license. 1 Since then,<br />

Ruby on Rails has quickly progressed to become one of the leading web development<br />

frameworks. This is in no small part due to the large community surrounding it who<br />

are constantly working on submitting patches to add new features or to fix existing<br />

bugs. Version 3 of this framework indicates yet another significant milestone in the<br />

project’s history and introduces some new concepts, but won’t leave those already<br />

familiar with the framework in the dark. The latest version of Rails is the primary<br />

focus of this book.<br />

1.1.1 Benefits<br />

Ruby on Rails allows for rapid development of applications by using a concept known<br />

as convention over configuration. When you begin writing a Ruby on Rails application,<br />

you run an application generator, which creates a basic skeleton of directories and<br />

files for your application. These files and directories provide categorization for pieces<br />

of your code, such as the app/models directory for containing files that interact with<br />

the database and the public/images directory for images. Because all of this is already<br />

there for you, you won’t be spending your time configuring the way your application is<br />

laid out. It’s done for you.<br />

How rapidly can you develop a Ruby on Rails application? Take the annual Rails<br />

Rumble event. This event aims to bring together small teams of one to four developers<br />

around the world to develop Ruby on Rails 2 applications in a 48-hour period. Using<br />

Rails, these teams can deliver amazing web applications in just two days. 3 Another<br />

great example of rapid development of a Rails application is the 20-minute blog<br />

screencast recorded by Yehuda Katz. 4 This screencast takes you from a no-application<br />

state to having a basic blogging and commenting system.<br />

Ruby on Rails affords you a level of productivity unheard of in other web frameworks<br />

because every Ruby on Rails application starts out the same way. The similarity<br />

1 The MIT license: http://en.wikipedia.org/wiki/MIT_License.<br />

2 And now other Ruby-based web frameworks, such as Sinatra.<br />

3 To see an example of what has come out of previous Rails Rumbles, take a look at their alumni archive:<br />

http://r09.railsrumble.com/entries.<br />

4 20-minute blog screencast: http://vimeo.com/10732081.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!