I am currently creating an api with rails.
Therefore, I am using jbuilder, but when I checked with the browser, all the output results are side by side, so it is very difficult to see.
How can I indent it beautifully?
I'm sorry to trouble you, but I'd appreciate it if you could teach me
For development purposes, you can use browser add-ons.
(Example) JSONView: https://addons.mozilla.org/ja/firefox/addon/jsonview/
Chrome also has
json-viewer
https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
There is an add-on like this.If it's just for development, I think using add-on like this is quite different.
If you want to make it easier to see the result of hitting with a command line such as curl,
jq
https://stedolan.github.io/jq/
This tool is the major
curl http://localhost:3000/api/v1/posts/|jq'.'
I think it will be easy to see if I give it to you like this
If you want to make it easy for users to see, it would be easy to understand that you can create a client or view that hits the api and make it beautifully shaped there...
© 2024 OneMinuteCode. All rights reserved.