1. Create new projects
- 檢查版本
ruby -v
rails -v
- 創(chuàng)建文件夾
mkdir Workbook
cd Workbook
- 創(chuàng)建rails框架專案
rails new first_app
cd first_app
bundle install
打開rails s
http://localhost:3000 - 保存
git init
git status
git add .
git commit -m "Added all the things"
2. Create scaffold
- 使用scaffold快速搭建topic
rails generate scaffold topic title:string description:text
rake db:migrate
重開rails s
http://localhost:3000/topics - 保存
git add .
git commit -m "add README"