Rails Generate is one of the features provided by Rails that would speed up the application development. However, we won’t be needing all the files generated by rails when running the generate command.
rails generate controller Home Index new create, would create the following set of files:
Fortunately, rails gives us the ability to customize its own generators so that we can disable these files from being generated. Once we place the below code in the
application.rb, it will stop the generation of these extra files.
config.generators do |g|
Now, when you run
rails generate controller Home Index new create, you will get less files.