Every time I created an application, I checked the curriculum, so I'll summarize it here for you to remember.
rails new application name-option
You can also specify the rails version before new
.
ex)_6.0.0_
A database management system can be specified as an option.
ex)-mysql
rails db:create
rails s
You can do it in another tab with command + T. Stop the server with "control + C".
rails g controller controller name (plural)
By leaving a space after the controller name and adding the action name, it is generated with the action described in the controller.
rails g model model name (singular)
rails routes
Check the URI, path, and action.
rails db:migrate
After modifying the migration file, execute it.
rails db:rollback
When you want to modify the migration file, you need to send it back once.
rails db:migrate:status
Check if the migration has been completed. up or down
Recommended Posts