Rails at a Glance
A (Very) Brief Look at Ruby on Rails
Ruby on Rails
(What is it?)
Ruby on Rails is a software library or web application framework, built upon the Ruby language. It’s a framework that establishes a set of conventions, which allow for a more streamlined approach to collaboration and code upkeep.
“Convention over configuration.” — The Rails Philosophy
By having a set of conventions in place, a developer only needs to worry about coding the unconventional aspects of their application. Unless you’re doing something completely wild or avant garde, chances are Rails has the necessary tools and templates to build any web application.
Laying Down the Track
A Brief History of Rails
Ruby on Rails was the result of the work David Heinemeier Hasnsson did on a project management tool for Basecamp (a web application company). What actually became Rails was extracted from that original project and was officially released on July of 2004. Popularity picked up two years later when Apple announced it would ship Ruby on Rails with theirMac OS X.
Major version updates:
- Rails 1.0 (2005) — the first pitch and improvements Prototype Scriptaculous 1.5 and 1.4.
- Rails 1.2 (2007) — REST and HTTP support
- Rails 2.0 (2007) — improvements in routing resources, multiview, HTTP authentication, session cookies to store
- Rails 2.0 (2008) — i18n, Ruby 1.9, JRuby
- Rails 2.3 (2009) — templates, Rack
- Rails 3.0 (2010) — new query engine, new router for the driver, protection CRSF
- Rails 3.1 (2011) — jQuery , SASS, CoffeeScript, Sprockets with Pipeline Assets
- Rails 3.2 (2012) — Journey, improvements in development mode
- Rails 4.0 (2013)
- Rails 4.1 (2014)
- Rails 4.2 (2014)
- Rails 5.0(beta) (2015)
Ballad of the Acronyms
CoC, MVC, and DRY — OH MY!
The Rails API has its foundation rooted in the architectural pattern of MVC or Model-View-Controller. Using MVC conceptually splits the software into three main parts, so that we can easily maintain them.
- Model: Represents the data and the application logic, such as what data is saved, and how that data should react to certain commands from the controller.
- View: Concerns the visual representation the user sees. It takes info from the Model (with potential instructions from the controller) to display the information.
- Controller: Represents action or the user’s inputs. The program waits for user’s input, then collaborates with the Model and View to make the appropriate changes.
Separation of concerns is king. We can avoid repeating ourselves with the MVC model through Rails.
Who’s On Board?
Real World Applications
(Too tired to think of a railroad related title)
- Regardless of what we’ll end up using, whether it be Rails, Sinatra, or another framework entirely, getting used to established design structures is something we’ll come to embrace.
- The MVC represents only one architectural pattern. We’ve already used another pattern: ActiveRecord.
- Complex and elegant web apps can be created using Rails and are even used by major companies today.