Skip to content

Instantly share code, notes, and snippets.

@twolfson
Created June 12, 2018 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/b191626ce5e810c9e8c5918e8f91369f to your computer and use it in GitHub Desktop.
Save twolfson/b191626ce5e810c9e8c5918e8f91369f to your computer and use it in GitHub Desktop.
Rails generator locations

lib/templates

We've had trouble finding our paths for templates before. Here's a good StackOverflow on the topic:

https://stackoverflow.com/a/37701125

To use this in practice, edit vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/actions.rb to dump source_paths and file:

Example for table migration:

{{project}}/lib/templates/active_record/model
../../migration/templates/create_table_migration.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment