MV

MVC

Used in 205 ruby projects (avg ★151)

Ruby
Architecture
Default
Used by 205 projects
webapp
api
cli

Details

Language / Topic
rubyRuby
Category
Architecture

Rules

balanced
- Use service objects for complex business logic — controllers call services, services call models. Keep controllers under 10 lines per action.
- Use presenters or view models for complex view logic — don't put formatting or display logic in models or controllers.
- Use concerns (`ActiveSupport::Concern`) to share behavior across models — but limit each concern to a single, cohesive responsibility.
- Use concerns for shared model behavior (Searchable, Auditable). Don't over-use — prefer composition.
- Use decorators or presenters for view-specific logic instead of putting it in models or helpers.
- Use Strong Parameters in controllers. Use form objects for complex multi-model form handling.
- Use callbacks sparingly — prefer explicit service calls for business logic side effects.