Home > Software engineering >  i want to return json as api response
i want to return json as api response

Time:04-12

I'm working with a Rails app, that has a few models.Having a CRUD of both models. I want to make my app accessible as an API and return JSON of my models. I only find tutorials or explanation of creating from zero a rails API, but i want to work with what i have already done. So far its just two scaffolds of 2 different models. I would like to be able to get JSON response from postman or curl.

If you could explain how to do it or a little help to understand how to do it.

CodePudding user response:

You can use a gem to do this,like fast_jsonapi link https://github.com/Netflix/fast_jsonapi explain https://medium.com/@clarkjohnson_85334/serialize-with-fast-jsonapi-4ee383ae23a5

  • Related