From 5c6f553196db1df26a80e99283d79d375ef10860 Mon Sep 17 00:00:00 2001 From: Nelson Figueroa <30811275+nelsonfigueroa@users.noreply.github.com> Date: Thu, 6 Feb 2025 09:03:00 -0800 Subject: [PATCH] rails: add `generate`, `db:migrate`, and `routes` examples (#15674) --- pages/common/rails.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/common/rails.md b/pages/common/rails.md index 7c61f0ce00..35882fbcf6 100644 --- a/pages/common/rails.md +++ b/pages/common/rails.md @@ -8,6 +8,18 @@ `rails new "{{project_name}}"` +- Generate a scaffold for a model named Post, predefining the attributes title and body: + +`rails generate scaffold Post title:string body:text` + +- Run migrations: + +`rails db:migrate` + +- List all routes: + +`rails routes` + - Start local server for current project on port 3000: `rails server`