first_app

1. Create new projects

  1. 检查版本
    ruby -v
    rails -v
  2. 创建文件夹
    mkdir Workbook
    cd Workbook
  3. 创建rails框架专案
    rails new first_app
    cd first_app
    bundle install
    打开rails s
    http://localhost:3000
  4. 保存
    git init
    git status
    git add .
    git commit -m "Added all the things"

2. Create scaffold

  1. 使用scaffold快速搭建topic
    rails generate scaffold topic title:string description:text
    rake db:migrate
    重开rails s
    http://localhost:3000/topics
  2. 保存
    git add .
    git commit -m "add README"

你可能感兴趣的:(first_app)