我使用rocket_pants
宝石打造后端API https://github.com/Sutto/rocket_pants自定义适配器以支持RocketPant使用Rails
它有特定的格式输出数据:
{
"response":[
{"id":1,"title":"Object Title","description":"Object Description"},
{"id":1,"title":"Object Title","description":"Object Description"} ],
"count":2,
"pagination": {
"previous":null,
"next":null,
"current":1,
"per_page":30,
"count":2,
"pages":1}
}
我使用Batman.RailsStorage
坚持模型。但是像MyApp.Model.get('all')
这样的动作在后端工作正常,但他们实际上不解析和加载模型对象。
你能指导我如何配置StorageAdapter
或写一个新的来处理这种类型的数据格式。
我们将不胜感激您的帮助/指导/支持。
感谢