Skip to content
Back to skills

Rails Resource

ASecurity

Scaffold a Rails resource with model, migration, controller, and routes

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 3, 2026
ai-agentsgorails

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill rails-resource --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rails Resource?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rails Resource
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-rails-resource/badge)](https://www.skillsdirectory.com/skills/black141312-rails-resource)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.