mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-30 17:33:50 +08:00
rails: add generate, db:migrate, and routes examples (#15674)
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user