1. Introduction
2. Rails Philosophy
3.1. Prerequisites
3.2. Creating Your First Rails App
3.3. Directory Structure
3.4. Model-View-Controller Basics
3. Creating a New Rails App
4.1. Autoloading in Development
4. Hello, Rails!
5. Creating a Database Model
Action Cable
Integrates WebSockets with the rest of your Rails application.
Action Controller
Core of a web request in Rails, handling parameters, sessions, and callbacks.
Action Mailer
Framework for sending emails from your application.
Action Mailer Subjects
Translations for Action Mailer e-mail subjects.
Action Text
Rich text fields support.
Action View
Responsible for generating the HTML for web responses.
Active Job
Framework for declaring background jobs and running them on queuing backends.
Active Record
Models interact with the application's database for persistence.
Active Record Migrations
Evolve your database schema over time using a Ruby DSL instead of pure SQL.
Active Record Translations
Translations for Active Record model names and error messages.
Active Record Validations
Ensure only valid data is saved into your database.
Active Storage
Facilitates uploading files to a cloud storage service and transforming uploads.
after_commit
Transaction callback that runs after a commit.
after_create
Callback that runs after an object is created.
after_find
Callback that runs after an object is loaded from the database.
after_initialize
Callback that runs after an object is initialized.
after_rollback
Transaction callback that runs after a rollback.
after_touch
Callback that runs after an object is touched.
API-only Application Mode
Configure Rails to start without browser features and serve JSON resources.
Associations
Represent relationships between models.
before_validation
Callback that runs before validation.
Callback Objects
Classes or modules encapsulating reusable callback behavior.
Callbacks
Hooks invoked during the object lifecycle.
change Method
Define forward changes Active Record can reverse automatically.
Chapters
Composite Primary Keys
Define composite primary keys in migrations.
Controller Modules
Select which Action Controller modules to include.
Custom Backends
Ability to use different I18n backends.
Date/Time Formats
Localized date and time formatting.
errors API
Inspect and handle validation error messages.
Example Code Style
Indent code two spaces; cover SQL, IRB, and Bash/command-line examples.
Execute SQL
Run raw SQL within a migration.
Foreign Keys
Add foreign key constraints and maintain referential integrity.
format
Validates an attribute against a regular expression.
Gem Installation
Install the latest Rails and its dependencies from RubyGems.org with gem install rails.
Resource Generators
Generate models, controllers, test stubs, and routes in one command.
Getting Started with Rails
has_many_attached
Attach multiple files to a record.
has_one_attached
Attach a single file to a record.
Hotwire
Front-end interactivity support.
Rails Internationalization (I18n) API
Add internationalization: translations, pluralization rules, and date formats.
Public I18n API
Ruby module with public methods defining how the library works.
length
Validates the length of an attribute.
Localized Views
Support for locale-specific view templates.
Method Visibility Documentation
Guidelines cover documenting dynamically generated methods and method visibility.
Middleware Selection
Choose, add, or remove middleware from the default stack.
Migration Generators
Generators create standalone migrations, tables, columns, and associations.
Mirror Service
Mirror files to subordinate services for backups and migrations.
Naming Conventions
Pluralized class names map to snake_case database tables, e.g. Book to books.
numericality
Validates that an attribute is numeric.
presence
Validates that an attribute is not empty.
Propshaft
CSS and JavaScript asset pipeline.
rails new
Generates the foundation of a fresh Rails application.
Rails Routing
Router recognizes URLs and dispatches them to a controller's action.
RDoc Documentation Generation
API docs are generated with RDoc via bundle exec rake rdoc into ./doc/rdoc.
RDoc Link Markup
Use relative RDoc link markup instead of absolute URLs to stay within the current docs version.
Resourceful Routing
Conventional mapping from HTTP to controllers for RESTful JSON APIs.
reversible Method
Specify reversible behavior within a migration.
Simple Backend
Default backend implementing the I18n API methods.
Solid Queue
Background jobs support.
uniqueness
Validates that an attribute value is unique.
up / down Methods
Explicitly define forward and reverse migration behavior.
UUID Primary Keys
Use UUIDs instead of IDs for primary keys.
Variants
Transform images into representations.
Version Verification
Verify the install by running rails --version, which prints the Rails version.
Wording Style
Use present tense, upper-case comment starts, and regular punctuation.