How to create a nifty_scaffold without worrying with the migrations?
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
精彩评论