rails-controller-patterns
Installation
SKILL.md
Rails Controller Patterns
Generate controllers following standard Rails RESTful conventions (7 actions, resourceful routing, before_actions, strong params).
Supporting Documentation
- patterns.md - Detailed controller patterns and examples
Core Principles
- Thin controllers: Handle HTTP concerns only; delegate business logic to its axis-appropriate home — on Axis A (
rails-stack-profiles),nativedelegates to models and concerns,extracteddelegates to service objects - RESTful by default: Stick to 7 standard actions; create new resource controllers for custom actions
- Strong parameters always: Never trust user input; use
params.expect(Rails 8+) - Consistent responses:
redirect_toafter success,render :action, status:on failure - One resource per controller: Avoid multi-resource controllers
- Dedicated resource controllers: Prefer
Cards::ClosuresControlleroverpost :closeonCardsController