DEV Community

Mengjia L
Mengjia L

Posted on

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).

Top comments (0)