Rails 生成脚手架后发现类的名字打错了,怎么补救

jiang_plus · February 16, 2013 · Last by adventurelw replied at February 16, 2013 · 2348 hits

用 rails 自带的 scaffold 生成一个脚手架后发现类的名字打错了,怎么补救? 好囧

rails destroy scaffold WrongName rails generate scaffold RightName

还有 destory scaffold!我以前都是小心翼翼地手工删除的……

#2 楼 @jiang_plus lol, and you can destroy models, controllers etc. too

source control

我通常是用 git clean 直接清除,然后重新 generate,这样比用 rails destroy 快

还是 git 吧

You need to Sign in before reply, if you don't have an account, please Sign up first.