Skip to content

Instantly share code, notes, and snippets.

@jaryl
Last active August 9, 2024 09:22
Show Gist options
  • Save jaryl/5338004f5ebf4bae55b6173b72fb647a to your computer and use it in GitHub Desktop.
Save jaryl/5338004f5ebf4bae55b6173b72fb647a to your computer and use it in GitHub Desktop.
Sample generators.rb file for rails apps
Rails.application.config.generators do |generate|
# generate.assets true # create assets when generating a scaffold
# generate.force_plural false # allow pluralized model names
# generate.helper true # generate helpers
# generate.integration_tool :test_unit # which tool generates integration tests (might be overwritten automatically if using rspec-rails)
# generate.system_tests :test_unit # which tool generates system tests (might be overwritten automatically if using rspec-rails)
# generate.orm false # which orm to use (false uses Active Record)
# generate.resource_controller :controller # which generator generates a controller when using bin/rails generate resource
# generate.resource_route true # generate a resource route definition
# generate.scaffold_controller :scaffold_controller # which generator generates a controller when using bin/rails generate scaffold
# generate.stylesheets true # generate stylesheets
# generate.stylesheet_engine :css # configures the stylesheet engine (for e.g. sass) to be used when generating assets. Defaults to :css.
# generate.scaffold_stylesheet true # creates scaffold.css when generating a scaffolded resource. Defaults to true.
# generate.test_framework false # which test framework to use (false uses Minitest) (might be overwritten automatically if using rspec-rails)
# generate.template_engine :erb # which template engine to use
end
@jaryl
Copy link
Author

jaryl commented Aug 9, 2024

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