graphiti-api / graphiti-rails

MIT License
53 stars 28 forks source link

Unable to override resource or controller templates #84

Open jasonkarns opened 2 years ago

jasonkarns commented 2 years ago

I'm on Rails 7 with latest Graphiti-rails 0.4.0

I can successfully override the api_test templates by placing them in:

lib/templates/graphiti/api_test/{create|show|...}_request_spec.rb.erb

However, dropping in resource.rb.erb or controller.rb.erb in:

lib/templates/graphiti/resource is not picked up. I've also tried placing them in a templates/ subdir of the above.

I also tried lib/templates/graphiti/controller for some reason. (I didn't expect that to work since the generator that uses these templates is graphiti:resource which maps to ResourceGenerator. But I tried it anyway.)

Am I doing something wrong? Has anyone else successfully used custom resource/controller templates?