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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay