$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Ruby on RailsbeginnerNew

Rails Setup

Share

Scaffold Ruby on Rails app with models and controllers

Works with OpenClaude

You are a Ruby on Rails developer. The user wants to scaffold a Rails application with models and controllers using Rails generators.

What to check first

  • Run rails --version to confirm Rails is installed (version 6.0+)
  • Verify Ruby is installed with ruby -v (2.7.0 or higher recommended)
  • Check that you have a blank Rails app created or are ready to create one with rails new myapp

Steps

  1. Create a new Rails application with rails new myapp --skip-test (or omit --skip-test if you want test files)
  2. Navigate into the app directory with cd myapp
  3. Generate a model with rails generate model Post title:string content:text author:string (replace Post and attributes as needed)
  4. Review the generated migration file in db/migrate/ to verify column types and constraints
  5. Run rails generate controller Posts to create a controller with associated views directory
  6. Execute rails db:migrate to apply the migration to your database
  7. Add RESTful routes by uncommenting or adding resources :posts in config/routes.rb
  8. Generate a full scaffold with rails generate scaffold Article name:string description:text published:boolean for a complete CRUD setup with views

Code

# After running: rails new myapp && cd myapp

# 1. Generate a Post model with attributes
# rails generate model Post title:string content:text author:string published_at:datetime

# The migration file created in db/migrate/[timestamp]_create_posts.rb will look like:
# class CreatePosts < ActiveRecord::Migration[6.0]
#   def change
#     create_table :posts do |t|
#       t.string :title
#       t.text :content
#       t.string :author
#       t.datetime :published_at
#       t.timestamps
#     end
#   end
# end

# 2. Generate a PostsController
# rails generate controller Posts index show new create edit update destroy

# 3. Add routes to config/routes.rb:
Rails.application.routes.draw do
  resources :posts
end

# 4. Run migrations
# rails db:migrate

# 5. Add model validations in app/models/post.rb:
class Post < ApplicationRecord
  validates :title, presence: true, length: { minimum: 5 }
  validates :content, presence: true
  validates :author, presence: true
end

# 6. Add basic controller actions in app/controllers/posts_controller.rb:
class PostsController < ApplicationController
  before_action :set_post, only: [:show, :edit, :update, :destroy]

  def index
    @posts = Post.all
  end

  def show
  end

  def new
    @post = Post.new
  end

  def create
    @post = Post.new(post_params)
    if @post.save
      redirect_to @

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
railsrubyscaffolding

Install command:

curl -o ~/.claude/skills/rails-setup.md https://clskills.in/skills/rails/rails-setup.md

Related Ruby on Rails Skills

Other Claude Code skills in the same category — free to download.

Want a Ruby on Rails skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.