DEV Community

Cover image for Ruby on Rails: Rome can be built in a day
Akhil
Akhil

Posted on • Originally published at blog.akhilgautam.me

Ruby on Rails: Rome can be built in a day

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:

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:
      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.
    • It also has a great documentation/guide 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 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

Ruby on Rails

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.

Top comments (1)

Collapse
 
fyodorio profile image
Fyodor

Thanks for the great overview 👍 Aren't you aware of any performance metrics/benchmarks for ruby-written APIs (as compared to Python, Go, Node or whatever else)?