rails-37-style-core-rails-controllers

Enforce 37signals Rails controller style with composable concerns.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy --skill rails-37-style-core-rails-controllers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-37-style-core-rails-controllers
Source: https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy/tree/main/rails-37-style-core-rails-controllers
Command: npx skills add https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy --skill rails-37-style-core-rails-controllers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of organizing Rails controller logic by promoting a pattern of thin controllers, rich models, and reusable controller concerns, leading to more maintainable and scalable applications.

Core Features & Use Cases

  • Thin Controllers: Ensures controllers act as orchestrators, delegating business logic to models.
  • Rich Models: Encourages placing complex logic within models for better organization and reusability.
  • Composable Concerns: Provides a catalog of reusable controller concerns for common tasks like resource scoping, request context, filtering, and security.
  • Use Case: When building a new feature that involves nested resources (e.g., comments on a card), you can include the CardScoped concern to automatically fetch the @card object and define standard actions like create and destroy with minimal controller code.

Quick Start

Use the rails-37-style-core-rails-controllers skill to understand how to implement thin controllers with reusable concerns.

Frequently Asked Questions about rails-37-style-core-rails-controllers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep my Rails controllers thin and move business logic to models?

Rails controllers should act as orchestrators by delegating business logic to rich models. You achieve thin controllers by using composable concerns for resource scoping, request context, and filtering, keeping controller code minimal.

What is the best way to handle nested resources in Ruby on Rails controllers?

The best way to handle nested resources in Ruby on Rails is by using composable controller concerns. Including a scoped concern automatically fetches parent objects and defines standard actions like create and destroy with minimal code.

How do composable concerns help organize Rails controller logic?

Composable concerns help organize Rails controller logic by providing a catalog of reusable modules for common tasks like resource scoping, pagination, and security patterns. This structure facilitates building maintainable and scalable applications.

Can I use Rails concerns for request context management and filtering?

Yes, you can use Rails concerns for request context management and filtering. The 37signals Rails coding style promotes extracting these common controller tasks into composable concerns to ensure controllers remain thin orchestrators.

When should I move controller logic into a Ruby on Rails model?

You should move complex logic into Ruby on Rails models when it enhances organization and reusability. Controllers should delegate business logic to rich models, ensuring a structured approach to application design and logic organization.

Does the thin controller pattern work for securing Rails applications?

The thin controller pattern works for securing Rails applications by encapsulating security patterns within reusable controller concerns. This approach ensures consistent access control and filtering without bloating the main controller actions.