Add simple API for parkings, that allows to get a list of parkings and individual parking details in JSON format.
Things to do:
- The
show and index method in ParkingsController should respond to html and json formats.
- The JSON representation of
Parking model should consist of id, kind, hour price, day price, number of places, and the address.
- The JSON representation of
Address model should consist of id, city, street, ZIP code.
- Add functional test to verify the returned JSON data.
- [Optionally] Exercise the API with a command line tool like
curl or wget.
Add simple API for parkings, that allows to get a list of parkings and individual parking details in JSON format.
Things to do:
showandindexmethod inParkingsControllershould respond tohtmlandjsonformats.Parkingmodel should consist of id, kind, hour price, day price, number of places, and the address.Addressmodel should consist of id, city, street, ZIP code.curlorwget.