Thor_for_rails_scaffold_generate_path
TL;DR
If you want to override jbuilder generator when scaffolding, put it Rails.root + lib/templates/rails/jbuilder/index.json.jbuilder
vim /Users/vimtaku/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions.rb
1 2 3 4 5 6 7 8 9 10 11 |
|
Background
I searched pathes for used generator, but I cant find where template is used. I’m using jbuilder.
lib/templates
Rails.root + lib/templates
dir is used as tempaltes path by default.
if you want to override jbuilder templates, you can put
Rails.root + lib/templates/rails/jbuilder/index.json.jbuilder
.
see also
thor-0.19.1/lib/thor/actions/file_manipulation.rb