Ruby Rails Refresher

Posted by JGB on November 25, 2019

After spending a lot of time focused on JavaScript and React, I realized I needed to brush up on my Ruby on Rails skills. Other than using Ruby on Rails to set up a backend API for most of my projects, I hadn’t really focused on Ruby on Rails and all that Rail and Ruby have to offer. So I decided to review some of the basics.

Ruby is an interpreted (versus compiled) object oriented programming language created by Yukihiro “Matz” Matsumoto in the early 1990s. Ruby is well loved because it is simple to read and most methods and classes are named in a logical fashion. It has a clear syntax and it is similar (syntacially) to Perl and C. Ruby has gone through many updates and there is great documentation and a great Ruby community. Some people dislike rails because there is a lot happening under the hood (the “ruby magic”). Ruby is easy to read which makes it enjoyable to work with. There are many libraries that extend Ruby and make developing your applications even easier; one of these is rails.

Ruby on Rails is a framework built for Ruby that allows you to create web applications. Rails was created by David Heinemeier Hansson in 2005. It is a collection of tools and code that give you a structure to work within. It is consistent and scalable. Once you get your Ruby on Rails application set-up, it is very easy to use and manage. It is highly organized and fully integrated. Ruby on Rails is very popular and is used by many popular sites such as Github. Instacart, Soundcloud, AirBNB, and CouchSurfing. The Rails philosophy values convention over configuration (COC) and DRY. Each rails application is set up with the rails structure and convention for naming files which makes your life as a developer easier. You can spend less time organizing your code and files and more time writing great code. Rails’ Active Record is the ORM (Object Relational Mapping) layer that handles data persistence. With your model (the M in MVC) you can set up your database and create associations and scope and validations. You can run migrations to push any updates or changes to your database. Ruby on Rails is a great framework that makes creating web applications fast and efficient and has everything you need to get started. With Ruby at its core, it is easy to read and feels seamless with its ‘ruby magic’.