Skip to content

Instantly share code, notes, and snippets.

@AshikNesin
Created September 10, 2015 11:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AshikNesin/52eb7e5e725ee4a6f2c0 to your computer and use it in GitHub Desktop.
Save AshikNesin/52eb7e5e725ee4a6f2c0 to your computer and use it in GitHub Desktop.
Rails generator controller without tests, assets & helpers

Configuring application.rb

To turn off without having to add options:

# application.rb
config.generators.assets = false
config.generators.helper = false

While Generating Controller

Try using --no- followed by optionname:

rails generate controller home index --no-helper --no-assets --no-controller-specs --no-view-specs

via StackOverflow

@skplunkerin
Copy link

Thank you, this is exactly what I needed. I also needed to stop views from being created, with:

config.generators.template_engine = false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment