使用 rails 2.2.2 自带的 scaffold 生成带命名空间的脚本架时(如 Admin::Product),scaffold 会生成带命名空间的model(app/models/admin/product.rb),并且生成的 controller 代码看起来也很怪异,不能工作,想到后面还有那么多 scaffold 要生成,一个一个手动改实不在符合 DRY 精神,So, 写个脚本做些自动清理调整的工作看来相当有必要。 when running scaffold came with rails 2.2.2 with namespace(i.e. Admin::Product), it generates new model with namespace(app/models/admin/product.rb) and controller code looks wierd, which normally you didn’t expect it, this script done some fixing for u 环境 Env ruby 1.8.7 / gems [...]