在一个带有Rails 4后端的基于Ember-cli的项目中 - 我需要能够保存(并最终读取)嵌套数据.数据模型很直接......
Survey
name: string
Question:
survey_id: integer
question_type_id: integer
text: string
Answer:
question_id: integer
text: string
A Survey hasMany Questions. Each Question hasMany Answers
Run Code Online (Sandbox Code Playgroud)
我想弄清楚如何编写自定义Survey序列化程序.根据我的研究,我知道我需要扩展DS.JSONSerializer - 但我不知道该怎么做.任何帮助将不胜感激.
谢谢