扩展Ember RESTAdapter以使用CouchDB [英] Extend Ember RESTAdapter to work with CouchDB
问题描述
我读了这里,我需要扩展提取
方法以使其正常工作,但是我感到害怕这整个事情,我不知道从哪里开始。 RESTAdapter
和 JSONSerializer
之间的关系是什么?我不知道这一切如何都融合在一起,我害怕浪费时间,也可能拧紧一些东西。还有一个更简单的方法可以做到这一点吗?
原谅我的无聊。
有一个CouchDB适配器似乎是最新的(最近更新于2天前),在 https://github.com/roundscope/ember-couchdb-kit 。正如它所说,受 pangratz / ember-couchdb-adapter 的启发,并包含许多修复和新手功能。
虽然在Rails项目中安装很简单,但是在Rails项目之外还是很好的。只需按照以下顺序从 dist
目录中的所有内容:
- ember-couchdb-套件
- 注册表
- 文件适配器
- 附件适配器
- revs-adapter
- change-feed
I am using CouchDB for basically my entire back-end, and Ember for basically my entire front-end, and I need to find a way to make the json data compatible between the two, especially regarding the 'named root' convention (here are the ember json expectations and the couch api). I'm not using Ruby or any other libraries, so I'm quite sure this couch adapter isn't available to me.
I read here that I'll need to extend the extract
method to get this to work properly, but I'm freaked out by this whole thing and am not sure where to start. What's the relationship between RESTAdapter
and JSONSerializer
? I'm not sure how this all fits together and I'm terrified of wasting time and possibly screwing something up. And is there maybe an easier way to do this?
Forgive my noobiness.
There's a CouchDB adapter that does seem to be up to date (last updated 2 days ago), at https://github.com/roundscope/ember-couchdb-kit. As it says, "Inspired by pangratz/ember-couchdb-adapter and contains many fixes and newbie features."
While the installation is easy within a Rails project, it's still fine outside of a Rails project. Just include everything from the dist
directory in this order:
- ember-couchdb-kit
- registry
- document-adapter
- attachment-adapter
- revs-adapter
- changes-feed
这篇关于扩展Ember RESTAdapter以使用CouchDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!