Skip to content

@avanc /emberjs using couchdb-adapter secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Try to get couchdb adapter running under emberjs.
TodoApp = Ember.Application.create({
LOG_TRANSITIONS: true
});
TodoApp.CouchDBAdapter = DS.CouchDBAdapter.extend({
db: 'testdb',
designDoc: 'todo',
});
TodoApp.Store = DS.Store.extend({
revision: 11,
adapter: TodoApp.CouchDBAdapter,
});
TodoApp.Todo = DS.Model.extend({
type: DS.attr('string'),
title: DS.attr('string'),
content: DS.attr('string'),
creator: DS.attr('string'),
created_at: DS.attr('string'),
done: DS.attr('boolean'),
});
TodoApp.ApplicationController = Ember.Controller.extend({
applicationName: 'Todo List'
});
TodoApp.Router.map (function() {
this.resource('about');
this.resource('todos');
});
TodoApp.TodosRoute = Ember.Route.extend({
model: function() {
return TodoApp.Todo.findQuery(TodoApp.TodoModel, {
type: 'view',
viewName: 'todos',
options: { include_docs: true }
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.