BookReview 过程

(1)

rails new BookReview

rails g model Book title:string description:text author:string

rake db:migrate

rails s

(2)

rails g controller Books

在books_Controller.rb 里添加  def index end  代码

rake routes

(3)

在gem中添加

  gem 'simple_form', '~> 3.1.0'

  gem 'bootstrap-sass', '~> 3.3.4.1'

bundle

rails g simple_form:install --bootstrap

在assets/stylesheets/application.css中添加(来源:simple_form官方github说明内容)

@import "bootstrap-sprockets";

@import "bootstrap";

并 改名为  application.css.scss

在assets/javascripts/application.js中添加  //= require bootstrap-sprockets

重新:

rails s

(4)

在books_Controller.rb 里添加  def 其他页面 end  代码  +  viewPage.html.erb

rails s

你可能感兴趣的:(BookReview 过程)