Links

Exercise

Here is a branch of the Rails app from yesterday but the API response for the shows#index route has been modified slightly. It now returns this response:

{
  "great-shows": [
    {
      "id": 1,
      ...
      actors: [
        {
          id: ...
        }
      ]
    },
    {
      "id": 2,
      ...
      actors: [
        {
          id: ...
        }
      ]
    },
    {
      "id": 3,
      ...
      actors: [
        {
          id: ...
        }
      ]
    },
    {
      "id": 4,
      ...
      actors: [
        {
          id: ...
        }
      ]

    }
  ]
}

As you can see, this is a bit different from the payload being returned yesterday. First, it has a non-normal key. Second, it has embedded relationships. So the exercise: set up a serializer to munge this payload so Ember Data can read it. You will most likely need to add an actor model that belongsTo the show model.

Hint: