Sinatra rendering JSON with Datamapper

Sinatra rendering JSON with Datamapper

While this link is a good overview of rendering json, remember this if you’re using datamapper:

  1. Make sure you require dm-serializer
  2. Make sure you run @object.to_json to get clean output
  3. Profit!