buffalo: Buffalo g r people generates invalid names
It seems that Buffalo resources generator is not using correct naming in some cases when using irregular plurals as people like:
$ buffalo g r people first_name:string last_name:string email:string identification:string
it:
- Uses
Personsas the plural inperson.gomodel. - Auto renderer looks for
templates/persons/*.htmltemplate instead oftemplates/people/*.html
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (15 by maintainers)
Before generating, locate inflections.json in the root of your buffalo app and add the preferred naming like so:
{ "singular": "plural", "person": "people" }buffalo build && buffalo testThe generate command will now respect the irregular naming convention as defined in the inflections doc. Pertinent output from my test run:
create templates/people/show.htmlrun buffalo db g model person first_name:string last_name:string email:string identification:stringcreate models/person.gocreate models/person_test.go