What is Rails?

You've met Ruby. Now meet her man.

01/21/2015

If you are like me, you have always heard of Ruby as Ruby on Rails. Well, up until this point, we have never seen anything that has to do with Rails. We have talked extensively about Ruby but never it's counterpart. Today, I want to spend a little time digging into what Rails is and why it is used. Wikipedia describes it as, "...an open source web application framework written in Ruby. Rails is a full-stack framework that emphasizes the use of well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), the active record pattern, and model–view–controller (MVC)." Did you catch all that? If not, don't worry. I am going to break it down.

First a little history. Rails was first released as open sourced in July of 2004. It was derived from the work of David Hansson from his work on Basecamp, a product of the company 37signals. Rails really started to take off in 2006 when Apple announced it would ship the framework inside it's new OS. From there, Rails has continued to grow in popularity due to its ease of use as well as its ubiquitous nature in all Apple laptops/desktops.

Let's spend some time breaking down a few of its features. Rails is first and foremost a framework. Software frameworks are useful because they provide a lot of basic functionality built in. For example in Rails, I can type rails new app_name into the console and Rails will generate a very basic but functioning web application complete with a model-view-controller (more on this later) setup. That is it. With one line I have just produced the foundation of an app that can in fact stand on its own. Rails uses other "scaffolds" to allow you to produce addition basic content for your application in the same way. Rails also utilizes the model-view-controller pattern, or MVC for short. MVC can be broken down into 3 parts (duh). The model is where the data is stored. It tells the application how to store the data in a database. The view is that part that is displayed on the browser. It is what a user would see and interact with. The controller is the connection between these two parts. It reads incoming requests from the user on the view and then goes to the model to retrieve the desired information.

There is far more about this framework we could talk about but we would be here all day. Hell, there are numerous books written about it. I'll wrap up with this. Ruby on Rails is used the world over to build agile, scalable web applications. Some of the largest sites running Ruby on Rails include GitHub, Yammer, Scribd, Shopify, Hulu, and Basecamp. As of May 2014, it is estimated that more than 600,000 web sites are running Ruby on Rails. (source: Wikipedia)