1

Ember 的 RESTAdapter 期望 JSON 响应的组织方式与 L4 Eloquent 的默认集合略有不同。

来自 Ember 指南:

{
  "post": {
    "id": 1,
    "title": "Rails is omakase",
    "comment_ids": [1, 2, 3]
  },

  "comments": [{
    "id": 1,
    "body": "But is it _lightweight_ omakase?"
  },
  {
    "id": 2,
    "body": "I for one welcome our new omakase overlords"
  },
  {
    "id": 3,
    "body": "Put me on the fast track to a delicious dinner"
  }]
}

有没有办法让 Ember 映射到 L4 集合?

4

1 回答 1

2

您需要覆盖序列化程序才能支持 laravel 的 json 格式。

看:

希望能帮助到你。

于 2013-06-06T09:49:32.557 回答