Learnr

Learn Ruby on Rails

Ship database-backed web apps fast with convention over configuration.

Free to start. No credit card. Or browse all courses.

What's inside your Ruby on Rails course

A sample path Learnr builds for Ruby on Rails. Your real course adapts to your goal and level.

  1. Ruby refresher and creating a Rails app
  2. Routes, controllers and views
  3. Active Record, migrations and validations
  4. Associations, forms and nested resources
  5. Authentication, Hotwire and background jobs
  6. Testing and deploying a Rails app

Ruby on Rails is a full-stack web framework written in Ruby that favors convention over configuration. If you name a model Article, Rails expects an articles table, an ArticlesController and views in app/views/articles, so you write very little wiring code. Active Record maps tables to classes, migrations version your database schema, and generators create working code in seconds. Modern Rails pairs server-rendered HTML with Hotwire, using Turbo and Stimulus for interactivity without a heavy JavaScript framework. Beginners learn by building a blog, then add users and associations. Learnr teaches Rails through a personalized course of bite-sized, interactive lessons.

How to learn Ruby on Rails, step by step

  1. Learn enough Ruby to read Rails code. Rails code relies on blocks, symbols, hashes and methods called without parentheses. Spend a week on plain Ruby so lines like has_many :comments, dependent: :destroy read as normal method calls rather than special syntax.
  2. Build the classic blog from the official guide. Run rails new, generate an Article model, and follow the Getting Started guide end to end. You touch routes, controllers, views, migrations and validations once, which gives you a map of the whole framework.
  3. Understand migrations and Active Record. Write migrations by hand, run bin/rails db:migrate, and roll back with db:rollback. Then open bin/rails console and query with where, order and find so you see the SQL Active Record generates in the log.
  4. Add users, associations and authorization. Add a User model and connect it with belongs_to and has_many. Recent Rails versions include an authentication generator, so study the code it creates, then check that people can only edit their own records.
  5. Practice testing and Hotwire. Write model tests for validations and a system test that clicks through a form. Then use Turbo Frames to update part of a page without a full reload, adding a small Stimulus controller only when you need custom behavior.
  6. Ship a second app on your own. Build something without a tutorial, such as a habit tracker or recipe box, and deploy it. Pair the project with short Learnr lessons on routing and Active Record queries to fill gaps as they appear.

What you'll learn

  • Create a Rails app and explain the model, view and controller roles
  • Design a schema with migrations and Active Record associations
  • Define RESTful routes with resources and nested routes
  • Validate data and render forms with error messages
  • Write model and system tests and add interactivity with Turbo

How long does it take to learn Ruby on Rails?

With some programming background, expect 4 to 8 weeks at 5 to 8 hours a week to build and deploy a simple Rails app. Feeling confident with associations, testing and performance typically takes 4 to 6 months. Learning Ruby from scratch adds a few weeks.

What you need before you start

Basic Ruby, HTML and a little SQL. You should be comfortable in the terminal, and knowing Git helps because Rails projects and deployments revolve around it.

Common mistakes to avoid

  • Fighting Rails conventions with custom names and folder layouts. Follow the naming rules and the framework does the wiring for you.
  • Editing a migration that has already run instead of writing a new one, which leaves teammates and production with different schemas.
  • Putting heavy business logic in views or controllers. Keep controllers thin and move rules into models or plain Ruby service objects.

How Learnr builds your course

Type your topic

Tell Learnr you want to learn Ruby on Rails, or get as specific as you like.

Get a personalized course

Learnr instantly builds a full Ruby on Rails course tailored to your goal and skill level.

Learn and level up

Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.

Ruby on Rails questions, answered

Should I learn Ruby before Rails?

Learn the basics first, even just a week or two. Rails makes much more sense once you understand blocks, symbols and classes, and debugging gets far easier.

Is Rails only for small projects?

No. Rails powers large, long-running applications such as GitHub and Shopify. Scaling them takes care with database queries, caching and background jobs, like any framework.

Do I need React to use Rails?

No. Rails ships with Hotwire for interactive pages built from server-rendered HTML. You can still pair Rails with React if a project calls for it.

Explore more courses

More programming and tech courses

See all programming and tech courses

Ready to learn Ruby on Rails?

Start your free, personalized Ruby on Rails course in seconds. It will be typed in and ready when you get there.

Start learning Ruby on Rails

Free to start. No credit card.