I am currently working on a recipe app that uses Ember on the frontend and a Rails API on the back. In Rails I have a has and belongs to many relationship between recipes and ingredients. My ingredients model not only stores the ingredient name, but nutritional information so I am not able to simple store ingredients as an array field on recipes.
I am currently confused about how I should set up my Rails API to send properly formatted JSON. According to this
Ember expects JSON to be formatted something like this:
Assuming this is correct, how should I achieve this in my Rails API?