If you don't need full CRUD, you can also create a custom JSON API.
classSomeController<ApplicationControllerdefjson_api# You can easily access the context# and set content_type like 'application/json'.# Look how easy to build a JSON serving API. context.response.content_type ="application/json" data = {name: "Amber", age: 1} data.to_jsonendend
Then in your routes file:
Alternatively you can use respond_with helper. Here you don't need to setup content_type, however the requested path requires a .json extension, by example /json_api.json
classSomeController<ApplicationControllerdefjson_api data = {name: "Amber", age: 1} respond_with do json data.to_jsonendendend