This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Last commit: 9d6686c (2013-03-22 19:26:49 -0700) | |
(function() { | |
window.DS = Ember.Namespace.create({ | |
// this one goes past 11 | |
CURRENT_API_REVISION: 12 | |
}); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var Bootstrap = window.Bootstrap = Ember.Namespace.create(); | |
})(); | |
(function() { | |
var get = Ember.get; | |
var Bootstrap = window.Bootstrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"projects": [ | |
{ | |
"updated": null, | |
"name": "USA", | |
"created": null, | |
"is_active": true, | |
"persons": [ | |
{ | |
"updated": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"blogs": [ | |
{ | |
"body": "Blah Blah Blah, is a song by American recording artist Kesha from her debut album, Animal.", | |
"author": "3OH!3", | |
"id": "2", | |
"comments": [ | |
{ | |
"blog_id": "2", | |
"desc": "Quest for Food", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var App = window.App = Ember.Application.create(); | |
App.Router.map(function () { | |
this.resource('projects', {path: '/projects'}, function(){ | |
this.route('new'); | |
this.resource('project', {path: '/:project_id'}, function(){ | |
this.route('edit'); | |
this.resource('members', {path: '/members'},function(){ | |
this.route('add'); | |
this.route('edit',{path: '/:member_id/edit'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var attr = Ember.attr, hasMany = Ember.hasMany, belongsTo = Ember.belongsTo; | |
var apiPrefix = '/api'; | |
App.CustomAdapter = Ember.RESTAdapter.extend({ | |
generateIdForRecord: function(record) { | |
var ch = "abcdefghiklmnopqrstuvwxyz"[Math.floor(25 * Math.random())]; | |
return ch+'xxxyxxx'.replace(/[xy]/g, function(c) { | |
var r, v; | |
r = Math.random() * 16 | 0; | |
v = c === 'x' ? r : r & 0x3 | 0x8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/routes.js | |
function Routes() { | |
this.resource('register', {path: '/register'}); | |
this.resource('login', {path: '/login'}); | |
this.resource('logout', {path: '/logout'}); | |
this.resource('projects', {path: '/projects'}); | |
this.resource('projectsNew', {path: '/projects/new'}); | |
this.resource('project', {path: '/projects/:project_id'}); | |
this.resource('projectEdit', {path: '/projects/:project_id/edit'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Routes() { | |
this.resource('register', {path: '/register'}); | |
this.resource('login', {path: '/login'}); | |
this.resource('logout', {path: '/logout'}); | |
this.resource('projects', {path: 'projects'}, function(){ | |
this.route('new', {path: '/new'}); | |
}); | |
this.resource('project', {path: 'projects/:project_id'}, function(){ | |
this.route('edit', {path: '/edit'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Person = Ember.Model.extend({ | |
id: Ember.attr(), | |
name: Ember.attr(), | |
addresses: Ember.hasMany(App.Address, {key: 'addresses'}) | |
}); | |
App.Address = Ember.Model.extend({ | |
id: Ember.attr(), | |
street: Ember.attr(), | |
person_id: Ember.attr(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
The MIT License (MIT) | |
Copyright (c) 2013 [email protected] | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
OlderNewer