Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Buffalo Generate Template Naming does not work for ressource name with two words #9

@kteb

Description

@kteb

I wasn't sure it was linked to gobuffalo/buffalo#1801 so I preferred to create a new issue, but basically the template folder doesn't have the right name.

buffalo new coke
cd coke
buffalo generate resource NewResource name
buffalo pop create
buffalo pop migrate
buffalo dev

Going on http://localhost:3000/specification_types/ I receive the following error:

new_resources/new.html: could not find template new_resources/new.html

Looking at the structure folder under template I found a folder new with inside an other folder resources instead of a folder new_resources that buffalo is expecting. If i copy all the folder structure in a folder templates/new_resources everything is working fine (with some fine tuning the includes).

The fun fact is than the buffalo destroy resource is looking to destroy templates/new_resources

I'm using buffalo 0.15.3 on a Windows WSL system.

I think the easiest way is to change this line https://github.com/gobuffalo/buffalo/blob/aa202b19ce380c61533b280daf56bf58de2f9a1b/genny/resource/resource.go#L51 with

g.Transformer(genny.Replace("folder-name", x))

or change everywhere to have the resources looking for the right template folder.

I wanted the feedback before creating a very simple or very complicated PR.

Metadata

Metadata

Assignees

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