Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<title>ToDo List</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CouchDB jQuery Examples</title>
<script src="script/jquery.js"></script>
<script src="script/handlebars.js"></script>
<script src="script/ember.js"></script>
<script src="script/ember-data.js"></script>
<script src="script/couchdb_adapter.js"></script>
<script type="text/javascript">
App = Ember.Application.create(); = DS.Store.create({
adapter: DS.CouchDBAdapter.create({
db: 'testdb',
designDoc: 'todo'
revision: 11
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('string'),
App.todo =, '72674863c864a2dde83ffa535a007e4c')
// Document is found and title is shown in tenplate (App.todo.title)
App.todo =, {
type: 'ToDo',
title: 'New ToDo',
content: 'Some Details',
creator: 'Me',
created_at: '2013-01-05',
done: 'false'
// Document is stored as expected
App.todos =, {
type: 'view',
viewName: 'todos',
options: {
include_docs: true
App.ApplicationView = Ember.View.extend({
templateName: 'application'
<script type="text/x-handlebars" data-template-name="application">
{{#each App.todos}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment