generators

Generate Rails models, controllers, migrations, and custom generators.

5|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/ThinkOodle/rails-skills --skill generators-thinkoodle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generators
Source: https://github.com/ThinkOodle/rails-skills/tree/main/skills/generators
Command: npx skills add https://github.com/ThinkOodle/rails-skills --skill generators-thinkoodle

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating new code components in Ruby on Rails applications, ensuring consistency, reducing boilerplate, and leveraging best practices for generating models, controllers, migrations, and more.

Core Features & Use Cases

  • Efficient Code Creation: Quickly generate models, controllers, migrations, mailers, jobs, and other Rails artifacts using built-in generators.
  • Custom Generator Development: Create project-specific generators to enforce unique patterns and accelerate development.
  • Use Case: When starting a new feature that requires a model, controller, and associated views, use the scaffold generator to create all necessary files with a single command, or use more specific generators like model and controller for finer control.

Quick Start

Use the generators skill to create a new model named 'Product' with a 'name:string' and 'price:decimal' attribute.

Frequently Asked Questions about generators

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

FAQPage Schema
How do I use Rails generators to create a new model and migration?

Rails generators automate model and migration creation by running command-line tasks like `rails generate model Product name:string price:decimal`, which produces the model file, database migration, and test stubs automatically.

What is the difference between the Rails scaffold and model generators?

The Rails scaffold generator creates a complete resource including the model, controller, views, and migration in one command. The model generator provides finer control by creating only the model file and associated migration.

How do I create a custom Rails generator for project-specific code?

Custom Rails generators are created by defining a class inheriting from `Rails::Generators::Base`, allowing you to enforce unique project patterns, automate boilerplate creation, and override built-in templates for deterministic code generation.

Can I override built-in Rails generator templates to enforce my own patterns?

Yes, Rails generators support template overriding. You can replace default template files by placing your customized templates in the correct application directory structure, ensuring all generated code matches your project's specific patterns.

When should I avoid using Rails scaffolding for new features?

Avoid Rails scaffolding when you need granular control over individual artifacts or when a feature requires custom logic that diverges significantly from standard CRUD operations; use specific generators like `controller` or `model` instead.