Slide 8
Slide 8 text
创建我的第一个 Rails 项目 -Cont.
●
gem install rails
●
rails --version
1. rails new blog
2. rails db:create
3. rails server
4. rails generate controller home index
5. rm public/index.html
6. Edit app/views/home/index.html.erb,
edit it to contain a single line of
code:
Hello, Rails!
7.Open the file config/routes.rb in your
editor. Add this line of code: root :to =>
"home#index"
8.navigate to http://localhost:3000 in your
browser, you’ll see Hello, Rails!.