Ruby on Rails
Ruby on Rails, or “Rails”, is an open-source server-side framework written in Ruby and used for building web applications. Rails provides a pre-built, boilerplate code that can be reused or customized in an application.
While particularly popular with startups, some well-known companies that use Rails include Airbnb, Basecamp, Github, Shopify, and SoundCloud.
Rails can be installed as a Ruby gem. However, the following prerequisites must be installed beforehand:
- Ruby version 2.7.0 or later, but preferably the latest version.
- SQLite3 is the default database used on Rails.
Help with installing these prerequisites can be found in “Getting Started with Rails”.
Lastly, Rails can be installed with the following command:
gem install rails
The MVC Pattern
Rails uses a common structural pattern known as the Model-View-Controller (MVC) pattern. It categorizes a web application’s code into three interconnected parts:
- The Model that defines the data structure of the application.
- The Views that use templates to represent the visual parts, like the Model data, of the application.
- The Controller that works between the Model and Views to perform business logic for the application.
Ruby on Rails is used across many industries for building web apps and services. This includes applications like marketing websites, Content Management Systems (CMSs), eCommerce sites, and custom web applications. Tasks for working with Rails may include:
- Creating templates that generate web pages for the front end.