Ruby Design Patterns (WIP)

mengjia

Mengjia L

Posted on August 9, 2024

Ruby Design Patterns (WIP)

Model

  • The Model represents the business layer of the application, responsible for handling business logic, validations, data persistence, and interactions with the database. (source)

Presenters (View)

  • There should be no ActiveRecord queries in views (source).
  • It should be separate from the business logic (here's a great explanation in case you are wondering what business logic means)

Controller

  • A controller can be thought of as a middleman between models and views. It makes the model data available to the view, so it can display that data to the user, and it saves or updates user data to the model (source).
💖 💪 🙅 🚩
mengjia
Mengjia L

Posted on August 9, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related