Skip to content

Unable to override resource or controller templates #84

@jasonkarns

Description

@jasonkarns

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions