Model-View-Controller

A Rails application is divided into three main areas: the Model, the View, and the Controller. Put simply, the Model is the data part—the database and any programmatic operations (such as calculations) that are done upon that data. The View is what the end user sees; in Rails terms, that generally means the web pages that appear in the browser. The Controller is the programming logic—the “glue” that joins the Model to the View.

The Model-View-Controller methodology is used in various forms by all kinds of programming languages and frameworks. It is more fully described in Digging Deeper in Digging Deeper. For the sake of brevity, I will henceforward call it MVC.

Get The Book of Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.