开发者

How to create a nifty_scaffold without worrying with the migrations?

开发者_如何学C

I need to use the nifty_scaffold to generate all the views and controller for my model, but I already have the model, the migration and the table in database, so I don't need it to generate the migrations. The problem is that when it founds an old migration, it says

Another migration is already named your_table: db/migrate/20090904212205_create_your_table.rb

and I can't create the whole scaffold.

Is there any way to ignore migrations on scaffolding in Rails?


script/generate nifty-scaffold MyModel --skip-migration

should work.


Since you already have the model, you can pass the --skip-model parameter. As shown in the railscast tutorial, try this:

script/generate nifty_scaffold user_session --skip-model username:string password:string new destroy
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜