Basics
The Basics
The Basics covers the everyday surface of a Wheels app — the routing, controller, view, and model work you’ll do on every feature. Each page is a task-oriented how-to. They’re ordered to follow a request through the framework, but every page stands alone — jump to whichever matches what you’re building right now.
You’ll find:
- Routing, controllers, and the seven REST actions
- Views, layouts, partials, and every form helper
- Validations and rendering errors back to the user
- Models, finders, associations, and the chainable query builder
- Migrations, seeding, and multi-datasource setups
All Basics guides
Section titled “All Basics guides” Routing Define routes — resources, nested resources, namespaced routes, custom patterns, and route helpers.
Controllers and Actions Writing a controller, the seven REST actions, filters, params, rendering, redirect, and flash.
Views, Layouts, Partials Rendering templates, the default layout, extracting partials, and how controller data reaches the view.
Forms and Form Helpers Every form helper Wheels ships — object-bound and tag-style — plus data-auto-id for stable test selectors.
Validation and Error Display Built-in validations, when they fire, the errors API, and rendering errors inline.
Models and the ORM Defining a model, finders, persistence, and lifecycle callbacks — the everyday ORM surface.
Associations Modeling relationships — hasMany, belongsTo, hasOne, nested creation, eager loading, cascade deletes.
Migrations Writing and running schema migrations — column types, indexes, foreign keys, and rollbacks.
Seeding Populate development and production databases with default records — idempotently.
Query Builder and Scopes Chainable query builder, reusable scopes, enum declarations, and batch processing.
Database and Multiple Datasources Configuring the default datasource, per-model overrides, transactions, and raw queries.
Shared Development Databases Reconciling the migration tracking table when several developers share one dev database.
See also
Section titled “See also”- Start Here — install Wheels and build your first app with the tutorial
- Core Concepts — the explanations behind what these guides show you how to do
- Digging Deeper — authentication, jobs, caching, uploads, and the rest of the advanced surface