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
?
It's not a well documented feature, but try to add --skip-template-engine
(alias --no-template-engine
) option to the command.
rails generate controller foo bar --skip-template-engine
demo on a dummy app:
rails g controller my_controller index show --no-template-engine
create app/controllers/my_controller_controller.rb
route get "my_controller/show"
route get "my_controller/index"
invoke test_unit
create test/functional/my_controller_controller_test.rb
invoke helper
create app/helpers/my_controller_helper.rb
invoke test_unit
create test/unit/helpers/my_controller_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/my_controller.js.coffee
invoke scss
create app/assets/stylesheets/my_controller.css.scss