I need help returning nested comments in JSON format that are sorted - see picture below. I don't care as to what model is used - adjacency, closure, nested, etc - but they would need to be returned as an array.
The Rails App is Rails 5, and uses PG. If you are going to use a Gem, please use one that is still being maintained.
You can use the template that I made, https://github.com/jrothrock/comments/tree/master/app, or you can use your own, it is up to you - all mine has in it is a comments controller, a hacked together adjacency list (schema), some seeds, and a model.
If you do use mine, just do a pull request.
Needs to show that the comments can go an infinite (not really infinite, but you get the idea) depth, have the ability to have multiple replies, as well as multiple root comments.
It doesn't have to match the exact JSON response as seen in the photos, but something close to it would be nice.