How to prevent Rails controller generator to modify config/routes.rb

后端 未结 7 1833
Happy的楠姐
Happy的楠姐 2021-01-11 13:27

Sometimes I run a command like rails g controller foo index to generate skeletons for controller and template.

Because I don\'t want to have helpers and

7条回答
  •  轮回少年
    2021-01-11 14:02

    This is counter intuitive, but here it is what you're looking for:

    config.generators do |g|
      g.skip_routes true
    end
    

提交回复
热议问题