(Assuming a project that does not use
rails g controller <controller name> <action name>
When you execute, a file that is not particularly needed is created in addition to
To avoid this, create the following file in the
When executing the
rails g controller command,
Files other than
view will not be created **.
Rails.application.config.generators do |g| g.assets false g.helper false g.skip_routes true end
If creating the above file is troublesome,
rails g controller command with the following three options added.
rails g controller <controller name> <action name> --no-assets --no-helper --skip-routes
The above has the following advantages.
- The stylesheets file is not created under
- Helper file is not created under
- Routes are not added in