Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/scaffold generator #1241

Open
eccegordo opened this issue Mar 28, 2019 · 4 comments
Open

resource/scaffold generator #1241

eccegordo opened this issue Mar 28, 2019 · 4 comments

Comments

@eccegordo
Copy link
Contributor

This issue is a (choose one):

  • [X ] Feature request.

Checklist before submitting:

  • [X ] I've searched for an existing issue.

Description

Is there or could there be something like a scaffold and/or resource generator?

In particular it would be very convenient if a simple generator that did the following:

create a model
create a generic "empty" controller that used JR
create create a resource with the same attributes as model
create a jsonapi_resources namespace in the router.rb

bonus points...

a generator that was relationship aware for sideloading and or able to do stub out basic filtering and pagination features.

@jamesconant
Copy link

@eccegordo - I did not previously see this feature request, but I had a similar desire so I whipped this up over the weekend. I'd be curious to get your (and anyone else's) feedback. There are a few questions I'd like to resolve before creating a PR in this repo for @lgebhardt to review (though his early feedback is obviously welcome too!).

@eccegordo
Copy link
Contributor Author

@jamesconant Hi sorry for very slow delay. Been busy with other projects. But starting to get back to trying JR. How do I try out this branch or PR? A cursory look this seems promising. Happy to try any code out. Trying to build a new API from scratch now in Rails 6.

@jamesconant
Copy link

Hi @eccegordo - If you check out the usage doc provided in the PR it should provide some guidance. In hindsight, i wonder if this level of templating is even really necessary. If you or someone else would like to take this PR and run with it, be my guest but at the moment I don't think I've got the bandwidth to follow up on it.

@jamesconant
Copy link

and no worries on the delay, life happens :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants