rubyguides

Tutorial series

Rails Basics

8 tutorials — follow in order for the best learning path.

  1. Getting Started with Ruby on Rails

    Learn how to install Rails, create your first application, and understand the basic directory structure of a Rails project.

  2. The MVC Pattern in Rails

    Learn how Rails implements the Model-View-Controller pattern, with a walkthrough of the request lifecycle, each layer's role, and real code examples.

  3. ActiveRecord Basics

    Learn how ActiveRecord ORM works in Ruby on Rails. Master models, database operations, relationships, and queries to build data-driven Rails applications.

  4. Migrations in Rails

    Learn how Rails migrations let you version-control your database schema using Ruby code. Create tables, add columns, and roll back changes safely.

  5. Views and Partials in Rails

    Learn how Rails views render HTML, use ERB templates, and reuse code with partials and layouts. Includes practical examples for beginners.

  6. Active Record associations in Rails: a practical tutorial

    Connect Rails models with belongs_to, has_one, has_many, has_many :through, and polymorphic associations. Includes migration tips and gotchas.

  7. Forms and Validations in Rails

    Learn how to build forms with form_with, protect them with strong parameters, and add validations to keep your data clean.

  8. Routing in Rails

    Learn how Rails routes HTTP requests to controllers and actions. This guide covers RESTful routes, custom routes, route constraints, and named routes.