是否可以在不产生迁移的情况下生成脚手架? [英] Is there an option to generate scaffolding without generating migrations?
本文介绍了是否可以在不产生迁移的情况下生成脚手架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Rails中困扰我的一件事是,脚手架会产生我并不总是需要的迁移.
One of the things that bothers me in Rails is that scaffolding generates migrations that I don't always need.
是否有一种无需相应迁移即可生成支架的方法?
Is there a way to generate the scaffold without the corresponding migration?
推荐答案
使用--skip-migration
参数.例如:
rails generate scaffold post title:string body:text --skip-migration
这篇关于是否可以在不产生迁移的情况下生成脚手架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文