Don't create view folder on rails generate controller

后端 未结 4 931
情歌与酒
情歌与酒 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 10:01

    If you're creating an API with no front end, you can go ahead and use rails new --api. However, I don't recommend this option if you do plan to create a front end (for example a single page app) because it turns a lot of things off, including the asset pipeline.

提交回复
热议问题