目录[-]
Rake命令
1
2
3
4
5
6
7
8
9
10
|
bundle
exec
rake -T 查看所有的Rake任务
bundle
exec
rake -T db 查看所有db命名空间的任务
bundle
exec
rake db:migrate
bundle
exec
rake db:rollback
bundle
exec
rake db:migrate VERSION=0
bundle
exec
rake db:create:all 根据database.yml文件创建好develop、
test
库,如果已存在,提示已存在
bundle
exec
rake db:
test
:clone 将develop数据库结构克隆到
test
库
bundle
exec
rake rspec
bundle
exec
rake assets:precompile RAILS_ENV=production
bundle
exec
rake notes:custom ANNOTATION=TODO
|
Generate命令
1
2
3
4
|
rails g(enerate) scaffold User name:string email:string --no-
test
-framework
rails g(enerate) controller StaticPages home help --no-
test
-framework
rails g(enerate) model Foo bar:string baz:integer
rails generate rspec:
install
生成RSpec配置文件(.rspec),用来存放测试文件的文件夹(spec),以及一个存储帮助函数的文件(spec
/spec_helper
.rb)
|
Destroy命令
1
2
3
|
rails d(estory) scaffold User
rails d(estory) controller StaticPages home help
rails d(estory) model Foo
|
New命令
1
|
rails new sample_app --skip-
test
-unit
|