Model-View-Controller Basics

Rails code is organized using the Model-View-Controller (MVC) architecture. With MVC, we have three main concepts where the majority of our code lives:

  • Model - Manages the data in your application. Typically, your database tables.
  • View - Handles rendering responses in different formats like HTML, JSON, XML, etc.
  • Controller - Handles user interactions and the logic for each request.

Now that we’ve got a basic understanding of MVC, let’s see how it’s used in Rails.

Powered by WebContainers
Files
Preparing Environment
  • Preparing Ruby runtime