Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Resource generator doesn't support "nested" values #364

Closed
markbates opened this issue Apr 6, 2017 · 8 comments
Closed

Resource generator doesn't support "nested" values #364

markbates opened this issue Apr 6, 2017 · 8 comments
Assignees
Labels
enhancement New feature or request help wanted Feel free to contribute!
Milestone

Comments

@markbates
Copy link
Member

buffalo g resource admin/planes name
Buffalo version 0.8.1.dev

--> actions/admin/planes.go
--> actions/admin/planes_test.go
--> locales/admin/planes.en-us.yaml
--> templates/admin/planes/_form.html
--> templates/admin/planes/edit.html
--> templates/admin/planes/index.html
--> templates/admin/planes/new.html
--> templates/admin/planes/show.html
--> buffalo db g model admin/plane name
v3.13.7

--> models/admin/plane.go
--> models/admin/plane_test.go
--> goimports -w .
actions/admin/planes.go:22:11: expected type, found '/'
actions/admin/planes.go:38:2: expected declaration, found 'if'
actions/admin/planes_test.go:9:34: expected '(', found '/'
actions/admin/planes_test.go:10:2: missing ',' in parameter list
actions/admin/planes_test.go:11:1: expected 'IDENT', found '}'
actions/admin/planes_test.go:13:1: missing ',' in parameter list
actions/admin/planes_test.go:17:34: expected '(', found '/'
actions/admin/planes_test.go:18:2: missing ',' in parameter list
actions/admin/planes_test.go:19:1: expected 'IDENT', found '}'
actions/admin/planes_test.go:21:1: missing ',' in parameter list
actions/admin/planes_test.go:25:34: expected '(', found '/'
actions/admin/planes_test.go:26:2: missing ',' in parameter list
actions/admin/planes_test.go:27:1: expected 'IDENT', found '}'
models/admin/plane.go:12:11: expected type, found '/'
models/admin/plane.go:22:2: expected declaration, found 'return'
models/admin/plane.go:26:11: expected type, found '/'
models/admin/plane.go:31:2: expected declaration, found 'return'
models/admin/plane_test.go:5:16: expected '(', found '/'
@markbates markbates modified the milestone: 0.8.2 Apr 6, 2017
@markbates markbates added enhancement New feature or request help wanted Feel free to contribute! labels Apr 10, 2017
@paganotoni paganotoni self-assigned this Apr 10, 2017
@markbates markbates modified the milestones: 0.8.2, 0.9.0 Apr 28, 2017
@markbates
Copy link
Member Author

I'm revisiting this. I've closed the ticket for #394 which directly impacted this ticket. I've had a change of heart as to how this ticket should be implemented. Here is my take on how this should work now:

$ buffalo g resource admin/plane

--> actions/admin_planes.go
--> actions/admin_planes_test.go
--> locales/admin/planes.en-us.yaml
--> templates/admin/planes/_form.html
--> templates/admin/planes/edit.html
--> templates/admin/planes/index.html
--> templates/admin/planes/new.html
--> templates/admin/planes/show.html
--> buffalo db g model plane name
v3.13.7

--> models/plane.go
--> models/plane_test.go
--> goimports -w .
$ buffalo g resource admin/plane --model-name=AdminPlane

--> actions/admin_planes.go
--> actions/admin_planes_test.go
--> locales/admin/planes.en-us.yaml
--> templates/admin/planes/_form.html
--> templates/admin/planes/edit.html
--> templates/admin/planes/index.html
--> templates/admin/planes/new.html
--> templates/admin/planes/show.html
--> buffalo db g model admin_plane name
v3.13.7

--> models/admin_plane.go
--> models/admin_plane_test.go
--> goimports -w .

@markbates
Copy link
Member Author

@apaganobeleno think you crank this out in the next two weeks given the new requirements?

@paganotoni
Copy link
Member

@markbates yes, i'll work on this over next 2 weeks

@markbates
Copy link
Member Author

awesome! :)

@paganotoni
Copy link
Member

@markbates i'm assuming for the router path should be /admin/planes, am i right ?

@markbates
Copy link
Member Author

That would be correct. :)

@paganotoni
Copy link
Member

@markbates aha! this one is tricky! that --model-name flag was not there :D, going for it

@paganotoni
Copy link
Member

Closed by #469

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Feel free to contribute!
Projects
None yet
Development

No branches or pull requests

2 participants