Permalink
Browse files

now using Ember.Resource.copy() to duplicate editable resource

  • Loading branch information...
1 parent b5f24ec commit f53dd2996090e8294bb4e507e12c2d974db89cbe @dgeb committed Apr 3, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 app/assets/javascripts/app/views/contacts/edit.js
@@ -3,12 +3,12 @@ App.EditContactView = Ember.View.extend({
templateName: 'app/templates/contacts/edit',
init: function() {
- // create a new contact that's a duplicate of the contact in the parentView;
- // changes made to the duplicate won't be applied to the original unless
- // everything goes well in submitForm()
- var editableContact = App.Contact.create(this.get('parentView').get('contact'));
- this.set("contact", editableContact);
this._super();
+
+ // Create a new contact that's a duplicate of the contact in the parentView;
+ // Changes made to the duplicate won't be applied to the original unless
+ // everything goes well in submitForm()
+ this.set("contact", this.get('parentView').get('contact').copy());
},
didInsertElement: function() {

0 comments on commit f53dd29

Please sign in to comment.