Don't create view folder on rails generate controller

后端 未结 4 926
情歌与酒
情歌与酒 2021-01-31 08:56

Is there a way with the usual generators config to turn OFF the creation of the view folders and action templates when you run a rails generate controller?

4条回答
  •  伪装坚强ぢ
    2021-01-31 09:52

    Just thought I'd try underscoring the --skip-template-engine flag to see if it worked in a generator and it worked a charm! No view templates generated from a bin/rails g controller command in a Rails 4.2 application.

    Try:

    config.generators do |g|
      g.template_engine false
    end
    

    A little late I know but these things stick around in Google! ;)

提交回复
热议问题