rails-controllers

Installation
SKILL.md

Rails Controllers

Structure

  • Only RESTful public actions: index, show, new, create, edit, update, destroy
  • If a controller needs custom public methods, extract them to a new controller scoped to that feature
  • Use respond_to in create, update, and destroy — not in index unless multi-format is needed

REST Mapping (resources, not verbs)

  • For non-CRUD actions, create a new resource rather than a custom verb on the existing controller
    • POST /cards/:id/closeCards::ClosuresController#create (POST /cards/:id/closure)
    • DELETE /cards/:id/closeCards::ClosuresController#destroy
    • POST /cards/:id/archiveCards::ArchivalsController#create
  • The new resource is often a real record (see "State as Records" in rails-models), so the controller stays plainly RESTful

Configuration Order

Always declare configuration in this order:

  1. Authentication/authorization declarations
  2. Rate limiting
  3. Before actions
Installs
2
First Seen
May 8, 2026
rails-controllers — gierd-inc/dev-skills