Skip to content

Instantly share code, notes, and snippets.

@levi
Created August 13, 2010 02:19
Show Gist options
  • Save levi/522135 to your computer and use it in GitHub Desktop.
Save levi/522135 to your computer and use it in GitHub Desktop.
MyApp.createController = SC.ObjectController.create({
_store: null,
content: null,
userBinding: SC.Binding.from('MyApp.currentController.content').oneWay(),
create: function() {
this._store = MyApp.store.chain();
var record = this._store.createRecord(MyApp.Entry, {});
this.set('content', record);
this.set('created', SC.DateTime.create());
this.set('privacy', 'private');
},
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment