Everything You Need to Know about Ruby on Rails Web Application Framework

Ruby on Rails, frequently referred to as just Rails or RoR, is a popular open-source framework. While it’s not the youngest kid on the block (it turned 16 in 2020), it’s still among the top choices for web application developers.

Rails has done more for startups than a whole boatload of Venture Capitalists. Rails has had an incredible impact on the startup ecosystem.

Eric Ries, founder of Lean Startup Movement

Eric Ries about RoR for business


It is frequently ranked as one of the top backend frameworks for the web. It’s used by some of the world’s biggest brands, such as Airbnb and Spotify. With good reason, RoR has also been built into macOS for many years. And there’s a vibrant, ever-growing community around Rails. Thousands of user-built gems make the development a breeze.

Guide on Ruby on Rails framework

Like it or not, Ruby on Rails is here to stay. But what is it really about? Is it the right choice in 2021, whether you want to quickly ship an MVP, build a full-fledged site, or migrate? Is it a good time to become an RoR developer? That’s what we’re here to discuss.

What is Ruby on Rails?

Ruby on Rails is a framework built on top of Ruby — a programming language created in the 90s. The idea behind RoR is straightforward — to give developers an intuitive framework to quickly develop robust, high-performing web pages.

Ruby’s original heresy was indeed to place the happiness of the programmer on a pedestal.

David Heinemeir Hanson - creator of Ruby on Rails framework

David Heinemeir Hanson, creator of RoR

Rails delivered on the promise. It gives you the structure to build nearly any web application. It simplifies the creation process and gives you an abundance of tools to handle tasks for you. And all of these contribute to what RoR creator, David Heinemeier Hansson, frequently emphasized—engineers’ happiness.

“Ruby’s original heresy was indeed to place the happiness of the programmer on a pedestal. Above many other competing and valid concerns that had driven programming languages and ecosystems before it.”

And this wasn’t just a marketing slogan. From the beginning, Ruby on Rails has been heavily focused on giving developers a clean, fun-to-use framework that is powerful and truly different from anything else. The community that grew around it and the abundance of resources they created only helped bolster the growth of RoR.

As Hansson put it in the Rails Doctrine:

“Where Python might boast that there’s ‘one, and preferably only one, way to do something,’ Ruby relished expressiveness and subtlety. Where Java championed forcefully protecting programmers from themselves, Ruby included a set of sharp knives in the welcome kit. Where Smalltalk drilled a purity of message passing, Ruby accumulated keywords and constructs with an almost gluttonous appetite.”

The entire piece gives a much deeper insight into the underlying concept of Rails. We highly recommend giving it a read.

Principles of RoR

Ruby on Rails is known as an MVC (model-view-controller) full-stack framework. The code is separated into three interconnected layers:

  • Model contains the logic of an application, all the essential data, and high-level classes.
  • View is the UI representation of the data present in Modal. It’s what users interact with and see on their screens.
  • Controller connects Model and View, receives user input, and decides how to handle the input.
  • To give you an example, let’s assume we’re building an app – an atlas of rare birds. The model is responsible for defining, for instance, how bird categories are defined and what data each listing contains. The view specifies how each screen of the app is rendered to users and what happens after each UI interaction. Finally, the controller receives each user’s input (for example, a search query), requests the needed data from the model, and tells the view how to display it.

    Ruby on Rails centers around two main principles, also known from other programming frameworks.

  • Do Not Repeat Yourself (DRY)
  • This first principle states: “Every piece of knowledge or logic must have a single, unambiguous representation within a system.” The logic behind it is straightforward. Coding the same things repeatedly, in different parts of an application, clutters the codebase, slows down development, and makes maintenance a lot harder.

    When developing in RoR, you split the application’s logic into smaller, reusable units. You then reuse them throughout the code by simply calling them. When you need to update either piece, you update once, and the change applies across the entire codebase.

  • Convention over Configuration (CoC)
  • This second principle is also about simplifying development and cutting down on time needed to ship the code. Convention over Configuration means that the RoR assumes various logical situations for you, by using the underlying, native functions, classes, variables and procedures.

    In this way, it decreases the number of decisions you make, and cuts down on the complexity usually associated with configuring each application area. And if you’re unhappy with the default settings, you can overwrite them with your code and adjust the environment to your needs.

    One self-evident example of a convention used in Rails is naming. Models we mentioned earlier are always named with a singular proper noun describing the object they represent: ‘user’, ‘portfolio,’ ‘project’. By default, Rails will name the corresponding tables with the plural versions of the modals and, to continue the example, a ‘users’ table will be created.

    It might not seem like a significant simplification, but if you were to name hundreds of tables with meaningful words manually, you would right away appreciate the convenience.

    History of Ruby on Rails

    David Heinemeir Hanson released RoR in July 2004. He extracted it from his work on the project management app, 37Signals (today known as Basecamp), and has been developing it ever since – at first by himself, and now with a dedicated core team.

    Ruby on Rails community

    Rails wasn’t just an enhanced version of Ruby. It was nothing short of a revolution in the programming world. As Tim O’Reilly of O’Reilly Media publishing house put it at the time:

    “Ruby on Rails is a breakthrough in lowering the barriers of entry to programming. Powerful web applications that formerly might have taken weeks or months to develop can be produced in a matter of days.”

    Eric Ries, the man behind the famous Lean Startup movement and book, spoke in a similar tone in one of his keynotes:

    “Rails has done more for startups than a whole boatload of Venture Capitalists. Rails has had an incredible impact on the startup ecosystem.”

    And RoR became nothing short of a significant success nearly overnight. In 2007, the newly-released Mac OS X v.10.5 (aka Leopard), shipped with RoR built-in. This led to a surge in popularity in developer communities worldwide and loads of applications shipped with Rails underneath. Each year would bring a new release, enhancing the possibilities and making the language more accessible to newcomers. At the time of writing, Ruby on Rails 6.0 and, as the release log would testify, the team shows no sign of slowing down.

    But first, there was Ruby…

    Before Rails took the market by storm, there was a Japanese guy named Yukihiro Matsumoto (or “Matz”). He created Ruby in 1993 and two years later released it to the world. He was fascinated with object-oriented languages, but none that existed at the time appealed to him. So he decided to do something about it. Here’s his quote from a post he made back in 1999:

    “As a language maniac and OO fan for 15 years, I really wanted a genuine object-oriented, easy-to-use scripting language. I looked for but couldn’t find one. So I decided to make it.”

    25 years later, Matz and his team still actively develop Ruby. Aside from being the code of RoR, Ruby is also a standalone language used to build web applications. Its next major release, v. 3.0, is set for the 2020 Christmas season.

    Rails is the killer app for Ruby.

    Yukihiro Matsumoto, Creator of Ruby language about Ruby on Rails framework

    Yukihiro Matsumoto, Creator of Ruby

    Popular applications built with Rails

    Ruby on Rails has been a go-to language for many years. As a result, many sites have been developed with Rails under the hood, and developers have gone in many different directions with the language.

    Of course, everything started with 37Signals / Basecamp, and unsurprisingly, their site has been powered by Rails ever since. As the hype progressed, many famous brands joined the party: GitHub, Airbnb, Zendesk, Groupon, Shopify, Hulu, Kickstarter, and others. Twitter also ran on RoR in the early days but has rebuilt its platform ever since.

    For us at Railsware, RoR has been the go-to solution for many years. We’ve developed dozens of successful Rails projects. Here are several examples: Popular web applications built with Rails - Calendly

    Calendly is a popular meeting scheduling app. The platform generates an individual link for your invitees to use to quickly schedule a meeting. The app integrates with your calendar and popular apps, such as Salesforce, PayPal, or Google Analytics. Web applications built with Ruby on Rails - BrightBytes

    BrightBytes is a data analytics platform for the education sector. It gathers insights from the world’s best experts and transforms it into evidence-based, actionable frameworks to improve education and boost students’ well-being. Web apps built with Ruby on Rails - Mailtrap

    Mailtrap is our own product—we took it from a small prototype to one of the world’s most popular email testing tools, with over 600,000 registered users. Mailtrap lets its users set up a safe testing environment and capture all outgoing emails. Then, users can inspect and improve them without any risk of spamming real users.

    For more, check out our list of Ruby on Rails websites.

    Is Ruby on Rails the right choice for businesses in 2021?

    It’s not uncommon to hear that Ruby is dead or nearing its extinction. It’s certainly no longer the most popular framework. It’s also not as sexy as it was back in the day. And yet, millions of developers still use it, and most are likely not going anywhere else. Ruby on Rails framework for business

    The most commonly used programming languages, as a percentage of those that took the Stack Overflow survey.

    Why is that? Ruby on Rails has many distinct advantages that, in 2021, still make it a viable option for businesses—but it won’t be perfect for all of them. But 16 years after its inception, we still use it for nearly every project, and over 1.5 million live sites are run with RoR under the hood.

    There are several reasons for this. For example:

  • It’s mature and continually evolving. Rails shows no sign of aging. Competitors might have taken the best parts and enhanced them. But RoR didn’t stay far behind. It kept getting better over the years, introducing lots of new features and making sure the whole ecosystem works flawlessly. It’s stable, predictable, and has a huge community of experienced developers around it.
  • It’s got a vast ecosystem. Over the years, the community has created an abundance of so-called Ruby Gems that simplify and speed up development. These are free packages (with just a few exceptions) that handle common tasks in Rails apps, such as integrations, parsing, monitoring, encryption, and virtually anything else that an app should handle. The number of gems grew into tens of thousands, and dozens of new ones are added every day.
  • It’s time- and cost-effective. Rails provides extensive ready-to-use code and assumes common conventions. As many parts of the code are reusable, you can ship code several times faster than you would with many other frameworks. And as an additional bonus, the code is cleaner, without the necessary boilerplate, and with much shorter maintenance time.
  • To give better advice on whether RoR is the right choice, let’s consider two scenarios:

  • You’re about to start building a site and are considering Ruby on Rails, or
  • You have a site running on RoR and are contemplating a change.
  • Is RoR the right choice for new projects?

    The reason Rails became so popular, especially among startups, is its speed of development. When building a so-called Minimum Viable Product (MVP), the time-to-market is of the utmost importance. You want to quickly ship a product, onboard the first users, and start iterating.

    Rails is the most well thought-out web development framework I’ve ever used.

    James Duncan Davidson about RoR web framework

    James Duncan Davidson, Creator of Tomcat and Ant.

    Ruby on Rails was built with all of these needs in mind, and is arguably the top choice for startups launching their products. It’s quick to develop a prototype with Rails – many are ready to take on their first users in just a few weeks. RoR makes this possible because of the abundance of gems (160k+ at the time of writing!) and the intuitive nature of a framework.

    Once you’ve confirmed your assumptions or found a different, viable business model, there’s no need to switch to another framework. Ruby on Rails is perfectly suitable for large projects with complex backends, thousands of users, and a wide array of functionalities.

    As such, Ruby is among the best options if you:

  • Want to quickly deliver an MVP or need to develop a web application with a tight deadline
  • Have a limited budget (as an additional bonus, RoR is open source and thus, free to use)
  • Need to quickly find a development team or hire experienced developers (as there are so many out there)
  • Have the need to handle complex logic. Because of the MVC structure of a framework, Ruby on Rails makes it very easy (and quick) to write complicated business logic succinctly, without the clunkiness typical of many frameworks.
  • Should you migrate from RoR?

    If you already have a product built on Ruby, you may be tempted to consider a switch to another, hotter framework. Ruby has several limitations that may give valid reasons for a move:

  • It’s not suitable for apps that heavily utilize modern trends, such as machine learning or blockchain. The gems library is huge, but focuses on more traditional capabilities and may have trouble handling very customized or unusual functionalities. For example, Python has a far richer ecosystem of libraries and resources focused on ML, and is a go-to framework for data scientists.
  • Rails isn’t the performance king either, but neither is it slow by any comparison. It’s entirely sufficient for the vast majority of sites on the web. However, those looking for ultrafast and lightweight frameworks with out-of-the-ordinary computing capabilities should probably look elsewhere.
  • RoR lacks some of the flexibility in scaling apps that JavaScript or PHP frameworks are famous for. It can be enhanced with various optimizations, such as rewriting computation-heavy parts or adding more CPU and RAM. Giant CRMs, CMSes, and many other platforms scale successfully and handle millions of users with ease. However, if you anticipate needing to handle billions of close to real-time interactions at a time (think, Twitter), RoR may not be the way to go.
  • With this in mind, let’s straighten up some common misconceptions about RoR.

    Is Rails slow?

    Rails isn’t slow by any definition. It can’t match some JS frameworks or Golang, but it is absolutely in line with many other popular frameworks’ performance. The speed can only be an issue with huge implementations that drive massive traffic. Even then, this can be often addressed with the right architecture and database structure.

    Does RoR’s age make it boring?

    Rails is also referred to as a boring framework because of its age and waning hype (which was once RoR’s trademark). But is that necessarily a bad thing? Maturity makes RoR stable and predictable. Hype comes and goes. RoR is here to stay.

    Having said that, if you’re struggling to scale your Ruby on Rails app, give us a shout. We’ll gladly jump on a call and advise, with full transparency, if RoR is still the way to go.

    If neither of the above points is a deal-breaker, then Rails will arguably serve you well for many years to come. The number of resources keeps growing, and the community is among the best and most active in the industry. The framework is actively developed and keeps getting better. And finding experienced developers or reputable agencies is as easy as it’s ever been.

    What are the typical Ruby on Rails implementations?

    As we said earlier, RoR isn’t perfect for all projects but handles many of them well. Here are the usual implementations:

  • Web applications of nearly any sort, with typical functionalities
  • Content management systems
  • Prototypes or MVPs
  • E-commerce stores, large and small
  • Accounting platforms and many others
  • MVPs and early-stage products are the typical implementations, for many of the aforementioned reasons. But there’s a lot more that you can build with Ruby on Rails.

    Should you learn Ruby on Rails in 2021?

    It can be tough to make up your mind about the next framework to learn with so many available options.

    Ruby on Rails is a breakthrough in lowering the barriers of entry to programming

    Tim O’Reilly about Ruby on Rails for development

    Tim O’Reilly, Founder of O’Reilly Media

    Depending on your interests, RoR may be one of the best on the list. Why? Let’s see.

  • There’s a vibrant community around it, and over 4.2k contributors to the RoR GitHub page (the hugely popular Django, Laravel, or ReactJS don’t even have half of that). The RoR community is active and known for being very open and helpful to newcomers.
  • It’s relatively easy to learn, especially if you already know JavaScript or a similar framework. The language is expressive, and the syntax is clean and easy to comprehend.
  • It’s quick to work with, and with the abundance of resources, you can deliver things in no time. Incredibly helpful if you’re planning to work on your own prototypes or pet projects.
  • Working with RoR inevitably means working closely with products. RoR teams are often found in startups, and they’re small and focused. Engineers are often exposed to customer insights and gain a deeper understanding of the product. This can be an invaluable experience if product management is your field of interest.
  • Coding in Ruby also pays well. According to the 2020 Stack Overflow Developer Survey, Ruby was among the frameworks guaranteeing the highest paycheck.
  • Rails does many things with logical conventions, so you can focus on the core of your application. The code is clean and easy to understand and maintain. “It’s just fun to use” was a widespread response when we asked our devs why they love coding in Rails.
  • When not to choose RoR?

    When should you opt for one of the Ruby alternatives instead of choosing RoR? Whichever way you go, you’ll need to have a general understanding of JavaScript along with HTML/CSS to become a successful web developer. For this reason, if you’re just getting started, picking up JS may be the right approach.

    If Rails appealed to you with its MVC architecture but something else didn’t quite match, ReactJS could be a viable alternative. It’s trendy, quickly growing, and is undoubtedly in demand. The same can be said about Laravel, which has grown a fantastic community around it and provides tons of resources for those just getting started.

    If you always want to be on top of the latest technology trends, you can’t overlook Python and its most popular framework, Django. It offers a rich ecosystem and an abundance of features that simplify development. Many of them came from Rails and enhanced it, quickly becoming some of the all-time favorites.

    Among other popular options, Java-based Spring and a JS family of Angular, Vue.js, and Express should certainly not be overlooked.

    Ruby on Rails framework compared to popular alternatives

    If you’re interested in a further comparison of these popular frameworks, be sure to check our articles:

  • Ruby vs PHP
  • Ruby vs Java
  • Ruby vs Python vs Node.js
  • Ruby on Rails resources

    Tutorials & Documentation:

  • Ruby on Rails official documentation
  • Ruby documentation
  • Really good, 4-hour video tutorial on the basics of Ruby
  • Intro to Ruby on Rails from Tutorialspoint
  • Long tutorial & sample app from railstutorial.org (Chapter 1 is free)
  • Long intermediate Rails tutorial from freecodecamp
  • Key RoR concepts explained at javatpoint
  • Collection of posts explaining RoR concepts from freecodecamp
  • A long list of Ruby idioms gathered on GitHub by @JuanitoFatas
  • Best Ruby on Rails courses and tutorials
  • RoR courses on Udemy
  • A selection of best books to learn Ruby on Rails
  • Top-rated Ruby books on Amazon
  • How to find Ruby on Rails developers
  • Ruby on Rails development services
  • Community:

  • Ruby on Rails official site
  • Rails forums
  • Rails GitHub page
  • RoR tag on Stack Overflow
  • r/rails on Reddit
  • RoR Slack channel
  • Official RubyGems community
  • Guide to RubyGems
  • Upcoming Ruby and Ruby on Rails conferences

    Due to the current global situation, many events have been canceled or postponed until next year. If you’re craving some Ruby gatherings online, there are a few opportunities coming up:

  • May 28th-29th, 2021 – EuRuKo 2021 (possibly live)
  • We’ll update the list as the situation progresses, so make sure you check back in some time.

    Glossary

    Here are the key concepts used throughout this page, in alphabetical order:

  • CoC – Convention over Configuration, an approach used in Ruby on Rails that prioritizes common conventions over the settings that would otherwise need to be configured manually. It speeds up and simplifies the development.
  • CMS – A platform used to manage content creation and editing—written text, audio, video, or any other media type.
  • DRY – Don’t Repeat Yourself, another approach used in RoR and other frameworks. It promotes the creation of small pieces of code that can be reused throughout the application. It makes development and maintenance faster.
  • MVC – Model-View-Controller pattern used in RoR and a number of other programming languages. It separates the application’s logic into three interconnected items.
  • Ruby – An open-source programming language developed by Yukihiro Matsumoto that became the core of Ruby on Rails. Ruby emphasises simplicity and developer productivity.
  • Ruby Gem – A piece of Ruby code that handles a common task and can be freely used in Ruby applications. Gems can contain one or several lines of code but can also span multiple files and handle complex features.