[Guide] Build a Test Project by Scaffold
1. Create a Test Project
rails new test_project
2. Turn into the Project
cd test_project
3. Init a Git
git init
git add .
git commit -m 'init'
4. Quick Make a CRUD News Page
rails g scaffold news title:string description:text
5. Create Related Table
rake db:migrate
6. Open by Sublime/Atom
subl .
atom .
7. Set the Index Page
Open include\route.rb
Find out #root 'welcome#index'
and modify it to root 'news#index'
8. Open the Index Page
rails server
Then go to http://localhost:3000/ …
留言