The framework that defined "convention over configuration". Rails turns a few commands into a full CRUD app — model, migration, controller, views and routes — with the legendary rails generate scaffold.
rails generate scaffold PostThis single command is Rails' party trick. Type a model name and fields, click run, and watch the entire CRUD feature stream into existence.
One line — resources :posts — generates seven conventional routes. Here's the simulated rails routes output.
# config/routes.rb Rails.application.routes.draw do resources :posts end
| Verb | URI Pattern | Controller#Action |
|---|---|---|
| GET | /posts | posts#index |
| GET | /posts/new | posts#new |
| POST | /posts | posts#create |
| GET | /posts/:id | posts#show |
| GET | /posts/:id/edit | posts#edit |
| PATCH | /posts/:id | posts#update |
| DELETE | /posts/:id | posts#destroy |
Active Record is Rails' ORM. Run queries against a simulated posts table — and see the SQL it produces, just like the real rails console.
A controller action pulls data and renders. Click an action to "request" it through the simulated server.
# app/controllers/posts_controller.rb class PostsController < ApplicationController def index @posts = Post.all render json: @posts end def show @post = Post.find(params[:id]) render json: @post end end
Why Rails feels so fast to build with.