Ruby on Rails: Rome can be built in a day
Tags: rails, ruby, webframework
Published: 2021-08-07 12:39:19

## What is Ruby on Rails?
Ruby is a language developed in the mid-1990s by Matz while Rails is a web framework developed in 2003 by DHH. Ruby on Rails can be used to build an MVP in minimal time. **It comes with all the basic tools needed to build an application, unlike other web frameworks that are just routers**.

## Let's first see some of the products built with Ruby on Rails
During the early days of my career when I used to tell my friends that I am working on Ruby on Rails, their first reaction used to be, `I haven't heard of it, is anyone even using it?` and my response used to be a list of applications that people are using every day that is running on Ruby on Rails. So here is a brief list:
- [GitHub](https://github.com)
- [Gitlab](https://gitlab.com)
- [Twitter](https://twitter.com)
- [Twitch](https://www.twitch.tv)
- [Airbnb](https://www.airbnb.com)
- [Hulu](https://www.hulu.com)
- [Coinbase](https://www.coinbase.com)
- [Soundcloud](https://soundcloud.com)
- [Shopify](https://shopify.com)
- [Dribble](https://dribble.com)
- [Unsplash](https://unsplash.com)
- [500px](https://500px.com)
- [Kickstarter](https://www.kickstarter.com)
- Visit https://stackshare.io/rails for more.

The products mentioned above are not small ones, but the ones that process millions of requests every day. Some of them are Rails monolith while some are using Rails in a few of their micro-services.

## Why Ruby on Rails?

- Rails is a "batteries included" framework
  - When a new project is created(`rails new <project_name>`), it is created with a directory structure that you will always find handy to put stuffs into. 
  - It comes with all the basic gems(libraries for non-rails people) that you will need to bootstrap a new product from zero.
  - It follows `Convention over Configuration`. Even when the project grows large you will know where to find what. Any new people can get going with a Rails project in no time.
  - It comes with generators that help you create MVC objects like controllers, views, models with a single command. For instance to create a new model, run `rails generate model <model_name>` or even shorter `rails g model <model_name>`
  - **ActiveRecord** is by far the best-loved feature of Rails. It is an ORM with such a straightforward syntax to create objects. For instance, creating a user object from the parameters looks like `User.create(<parameters>)`
  - Entire Rails framework has a DSL that is human-readable and at the same time performant on machines. For instance, the following code-block shows a *model* declaration in Rails:
    ```ruby
      class Post < ApplicationRecord
        belongs_to :user
        has_many :comments
        validates_presence_of :title
      end
    ```
  - Let's not forget the fact that it has an active community with awesome people who are contributing day in and day out to Rails and other [gems](https://rubygems.org/gems).
  - It also has a great [documentation/guide](https://guides.rubyonrails.org/) that can be referred to, to get up and running on Rails.

----

- Ruby is ❤️
  - It is one of the easiest languages to learn with a heck of a lot of free tutorials and guides.
  - Ruby's [ official documentation](https://docs.ruby-lang.org/en/3.0.0/String.html) beats every other existing language with its simplicity.
  - The metaprogramming in Ruby allows for the creation of intuitive DSLs and APIs that are too difficult to achieve in other languages.


----

## Resources to learn Ruby on Rails
Ruby on Rails repo: https://github.com/rails/rails

#### Ruby
  - https://rubymonk.com/
  - https://academy.bigbinary.com/learn-ruby
  - http://rubylearning.com/satishtalim/tutorial.html
  - https://www.ruby-lang.org/en/documentation/quickstart/
  

#### Ruby on Rails
  - https://guides.rubyonrails.org/
  - https://www.youtube.com/c/DriftingRuby
  - https://gorails.com/
  - https://www.bigbinary.com/learn-rubyonrails-book
 

After going through the above resources, you can start looking into open-source applications built with Ruby on Rails to get a better understanding of real-world applications. Upon getting acquainted with them, you can even start contributing to them.


Thanks for reading. Feel free to add your comments. Do like and share if you find this information useful.