Skip jbuilder files when I generate a scaffold?

元气小坏坏 提交于 2020-05-25 15:24:12

问题


When I scaffold I don't want it to generate these files:

invoke    jbuilder
create      app/views/tests/index.json.jbuilder
create      app/views/tests/show.json.jbuilder

But how? in my application.rb I have this:

config.generators do |g|
  g.assets            false
  g.helper            false
  g.test_framework    nil
end

回答1:


Use

config.generators.jbuilder = false

or

config.generators do |g|
  g.assets            false
  g.helper            false
  g.test_framework    nil
  g.jbuilder          false
end



回答2:


Deleting or commenting out jbuilder from you Gemfile will do the trick.

https://stackoverflow.com/a/24104811/5521564



来源:https://stackoverflow.com/questions/22484281/skip-jbuilder-files-when-i-generate-a-scaffold

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!