How to stop the files which are auto generated in rails?

Kaycheng
2 min readJun 19, 2021

--

How to skip the files which are auto created by rails generate controller.

When we create rails projects. Most of time, we will use many rails command to create model, controller and view. Because it's easily and useful. But there is a big problem about the command, the problem is when we use the command, then it will be created more files than we need.

There are some files that we don't need.

So we can add some code in config/application.rb to stop the condition.

After we add the code which is from the square, then try the command again. You will find it's only created two files which we want this time.

By the way, before you try the same command again. Please remove the files you have created first.

$ rails remove model model_name

The model_name is "user" here.

Info:

--

--

No responses yet