controllers

Automate Rails controller design with RESTful actions and strong parameters.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/pelletencate/iron-horse --skill controllers-pelletencate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: controllers
Source: https://github.com/pelletencate/iron-horse/tree/main/skills/controllers
Command: npx skills add https://github.com/pelletencate/iron-horse --skill controllers-pelletencate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build robust and maintainable Rails controllers that adhere to RESTful conventions, strong parameters, and a lean architecture.

Core Features & Use Cases

  • RESTful actions: index, show, new, create, edit, update, destroy with clear routing.
  • Strong parameters: consistent parameter filtering to prevent mass-assignment.
  • Skinny controllers: delegate business logic to models/services and keep HTTP concerns in controllers.
  • Nested resources and concerns: scalable composition of related resources.
  • API controllers: patterns for API-first Rails controllers and versioning.
  • Routing conventions: guidance on clean, conventional Rails routes.

Quick Start

Create a new RESTful controller, wire a resource route, and start refactoring logic into services while applying strong parameters.

Frequently Asked Questions about controllers

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

FAQPage Schema
How do I structure skinny Rails controllers with RESTful actions?

To build skinny Rails controllers, delegate business logic to models or services while keeping HTTP concerns in the controller. This ensures standard RESTful actions like index, show, new, create, edit, update, and destroy remain maintainable and lean.

What is the best way to implement strong parameters in Rails controllers?

Implementing strong parameters in Rails controllers requires explicit parameter whitelisting to prevent mass-assignment vulnerabilities. This technique consistently filters user input, ensuring only permitted attributes are passed to your models during CRUD operations.

How do I handle nested resources and concerns in Rails controllers?

Handling nested resources and concerns in Rails controllers involves scalable composition of related resources. Using controller concerns allows you to share reusable RESTful patterns across multiple resources, maintaining a clean architecture.

Can I use Rails controllers for API endpoints and versioning?

Yes, you can build API-first Rails controllers using established patterns for API endpoints and versioning. This approach maintains RESTful routing and strong parameter enforcement while serving structured API responses.

Why should I delegate business logic to services instead of models?

Delegating business logic to services supports skinny controller architecture by isolating complex operations from both HTTP concerns and database persistence. This separation keeps Rails controllers clean and models focused on data integrity.

When do I need controller concerns in a Rails application?

You need controller concerns in a Rails application when you want to extract and share reusable RESTful patterns across multiple resources. This approach prevents code duplication and maintains a clean, conventional routing structure.