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
module.exports = { | |
autoPK: false, | |
attributes: { | |
id: { | |
type: 'integer', | |
primaryKey: true, | |
autoIncrement: true | |
} |
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 objectName = {}; // This is just declaring a object if you nothing to put in it. | |
// some frameworks do stuff like this | |
objectName = { | |
name: "Brian", | |
dosomething: function(res){ | |
console.log('something'); | |
} | |
} |
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 = Ember.Application.create(); | |
//var posts = [{id: '1', title: "Rails is Omakase", author: { name: "d2h" }, date: new Date('12-27-2012'), excerpt: "There are lots of à la carte software environments in this world. Places where in order to eat, you must first carefully look over the menu of options to order exactly what you want.", body: "I want this for my ORM, I want that for my template language, and let's finish it off with this routing library. Of course, you're going to have to know what you want, and you'll rarely have your horizon expanded if you always order the same thing, but there it is. It's a very popular way of consuming software.\n\nRails is not that. Rails is omakase."}, { id: '2', title: "The Parley Letter", author: { name: "d2h" }, date: new Date('12-24-2012'), excerpt: "My [appearance on the Ruby Rogues podcast](http://rubyrogues.com/056-rr-david-heinemeier-hansson/) recently came up for discussion again on the private Parley mailing list.", body: "A long list of topics were raised |
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.ModelIndexController = Ember.ObjectController.extend({ | |
//stuff | |
}); | |
App.ModelNewController = Ember.ObjectController.extend({ | |
//stuff | |
}); | |
App.ModelController = Ember.ObjectController.extend({ | |
index: function(){ |
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
/** | |
* 200 (OK) Response | |
* | |
* Usage: | |
* return res.ok(); | |
* return res.ok(data); | |
* return res.ok(data, view); | |
* return res.ok(data, redirectTo); | |
* return res.ok(data, true); | |
* |
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
window.App = Ember.Application.create({ | |
LOG_TRANSITIONS: true | |
}); | |
App.Router.map(function(){ | |
this.resource('about'); | |
this.resource('users'); | |
}); | |
App.Router.reopen({ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Testing Ember</title> | |
<style>.active{font-weight: bold; text-decoration: none;}</style> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<nav> | |
{{#link-to 'index'}}Home{{/link-to}} | |
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
/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} | |
.active {font-weight: bold;} |
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.Member = DS.Model.extend({ | |
username: DS.attr('string'), | |
type: DS.attr('string'), | |
createdAt: DS.attr('date'), | |
updatedAt: DS.attr('date'), | |
}); |
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.ApplicationSerializer = DS.JSONSerializer.extend({ | |
serializeIntoHash: function(hash, type, record, options) { | |
Ember.merge(hash, this.serialize(record, options)); | |
} | |
}); |
OlderNewer