Other Pages

MVC Overview

Explaining MVC and Records

Rails implements a very specific notion of the Model/View/Controller pattern, which guides how you structure your web applications.

Model

saves data to the database

accesses data from the database

bridge between the database and objects

View

display the data for human (or machine) consumption

webpages are views

Controller

acts as the glue between the models and the views

combines data from multiple models

summarizes and filters data

In MVC, models, views, and controllers have very specific jobs. Separating responsibilities like this make it easy to maintain and extend rails applications. When responsibilities become muddied it gets much harder to debug issues and add new functionality.

Going through this curriculum on your own? Get help on our Discourse forum, where RailsBridge volunteers can answer your questions.

If you have a suggestion for improving the docs, please make a pull request or drop us a note via GitHub Issues (no technical knowledge required).