Scaffold a Rails resource with model, migration, controller, and routes
Scanned 9/3/2026
Install to Claude Code
npx -y skills add black141312/ada --skill rails-resource --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Rails Resource?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/black141312-rails-resource)More formats (shields.io, HTML) on the badges page.
---
name: rails-resource
description: Scaffold a Rails resource with model, migration, controller, and routes
category: frameworks
---
# Rails Resource
Use to add a new resource to a Rails app — model + migration, RESTful controller, and routes — following convention over configuration.
1. Generate it: `rails generate scaffold <Name> field:type ...` (or `model` + `controller` separately for finer control).
2. Review the migration, adjust columns/indexes/null constraints, then run `rails db:migrate`.
3. Add `resources :<plural>` to `config/routes.rb` (only needed if you didn't use full scaffold), scoping or nesting as appropriate.
4. Lock down `params` with a strong-parameters `permit` list in the controller; add validations to the model.
5. Adjust controller actions and views to match real requirements; remove unused scaffold actions.
6. Run `rails server` and the generated tests; verify CRUD via the routes (`rails routes` to confirm paths).
## Rules
- Always use strong parameters (`params.require(:x).permit(...)`); never pass raw `params` to `create`/`update`.
- Put validations and business rules on the model, not the controller.
- Keep controller actions thin and RESTful; reach for service objects before bloating actions.
- Add DB-level constraints/indexes in the migration, not just model validations.
- Run `rails db:migrate` (and commit `schema.rb`) before relying on the new table; never edit `schema.rb` by hand.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!