action-controller

Installation
SKILL.md

Rails Action Controller Expert

Write correct, secure, and idiomatic Rails controllers following Rails 8.1 conventions.

Philosophy

  1. Thin controllers — Business logic belongs in models/services, not controllers
  2. Strong parameters protect against mass assignment — Raw params let attackers set any attribute (admin flags, user IDs, etc.)
  3. Convention over configuration — Follow RESTful patterns; fight the urge to add custom actions
  4. Fail secure — Default to restricting access, then open up selectively
  5. One controller, one resource — If your controller handles two resources, split it

When To Use This Skill

  • Writing new controller actions (CRUD or custom)
  • Permitting parameters (especially nested hashes/arrays — this is where bugs live)
  • Adding before_action filters for auth/authorization
  • Setting up rescue_from for error handling
  • Working with sessions, cookies, or flash messages
Related skills

More from thinkoodle/rails-skills

Installs
4
GitHub Stars
4
First Seen
12 days ago