Ruby on Rails is a full-stack web application framework built on the Model-View-Controller (MVC) architectural pattern, emphasizing convention over configuration to minimize boilerplate code. Rails integrates ActiveRecord for database interactions, ActionController for request handling, ActionView for templating, Active Storage for file uploads, Action Text for rich content, and Hotwire for real-time features—making it a comprehensive solution for building production-ready web applications. Rails 8 further simplifies deployment with Solid Queue, Solid Cache, and Solid Cable (database-backed replacements for Redis/Sidekiq), Kamal for zero-downtime Docker deployments, Thruster as a lightweight HTTP/2 proxy, and a built-in authentication generator, reducing the need for external infrastructure while maintaining the framework's famous developer velocity.
What This Cheat Sheet Covers
This topic spans 25 focused tables and 253 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: MVC Architecture Components
| Component | Example | Description |
|---|---|---|
class User < ApplicationRecord validates :email, presence: trueend | Ruby class inheriting from ApplicationRecord — defines database structure, validations, associations, and business logic using ActiveRecord ORM. | |
def show @user = User.find(params[:id]) render :showend | Intermediary handling HTTP requests — fetches data via models, processes logic, and passes data to views for rendering responses. | |
<h1><%= @user.name %></h1><%= link_to "Edit", edit_user_path(@user) %> | ERB template rendering dynamic HTML — uses embedded Ruby (<%= %>) to inject data and helper methods for HTML generation. | |
resources :usersget 'profile', to: 'users#show' | Maps HTTP verbs + URLs to controller actions — generates RESTful routes automatically or defines custom paths for specific endpoints. |