我想使用rails-3.2脚手架为现有模型生成测试(Test :: Unit)。
我已经尝试了几个命令并且遇到了以下错误:
invoke active_record
The name 'MyModel' is either already used in your application or reserved by
Ruby on Rails. Please choose an alternative and run this generator again.
我使用了以下命令,结果是一样的:
rails g scaffold MyModel --skip
rails g scaffold MyModel -s
rails g scaffold MyModel -t -s
我也尝试使用gem schema_to_scaffold指向scaffold的所有MyModel字段,但它没有结果。
rails generate scaffold MyModel fio:string #..all fields of my model..# -s
提前致谢!