1. 安装ruby环境
2. 安装bundle(手工安装:gem install bundle-x-x.gem)
3. 安装rails(手工安装: gem install gems\rails-x.x.x\*)
4. 创建工程(rails new myapp -d mysql -T -J)
5. 修改数据库配置
6. 添加一些基本插件(拷到gemfile: gem 'rspec-rails'; gem 'jquery-rails'; gem 'will_paginate'; gem 'haml-rails'; gem 'compass')
7. 绑定gem(bundle install --local)
8. 修改主页(①:rails g controller home index②:删掉public\index.html③:修改routes)
9. 初始化数据库(rake db:create)到此项目基本可以运行了(rails s)
10.创建产品(rails g scaffold post name:string ...)或(rails g model post name:string ...)或(rails g controller post index show new edit create update destroy)可删除(rails destroy scaffold post; rails destroy model post; rails destroy controller post)
11. 初始化post数据库表(rails db:migrate)
2. 安装bundle(手工安装:gem install bundle-x-x.gem)
3. 安装rails(手工安装: gem install gems\rails-x.x.x\*)
4. 创建工程(rails new myapp -d mysql -T -J)
5. 修改数据库配置
6. 添加一些基本插件(拷到gemfile: gem 'rspec-rails'; gem 'jquery-rails'; gem 'will_paginate'; gem 'haml-rails'; gem 'compass')
7. 绑定gem(bundle install --local)
8. 修改主页(①:rails g controller home index②:删掉public\index.html③:修改routes)
9. 初始化数据库(rake db:create)到此项目基本可以运行了(rails s)
10.创建产品(rails g scaffold post name:string ...)或(rails g model post name:string ...)或(rails g controller post index show new edit create update destroy)可删除(rails destroy scaffold post; rails destroy model post; rails destroy controller post)
11. 初始化post数据库表(rails db:migrate)