Skip to content

Instantly share code, notes, and snippets.

@mattmcginnis
Created September 24, 2013 19:08
Show Gist options
  • Save mattmcginnis/6689700 to your computer and use it in GitHub Desktop.
Save mattmcginnis/6689700 to your computer and use it in GitHub Desktop.
var MembersNewRoute = Ember.Route.extend({
email: '',
beforeModel: function(transition) {
var registrantKey = transition.params.registrant_key;
this.store.find('registrant', registrantKey).then(function(registrant) {
// "this" is undefined
this.set('email', registrant.email);
});
},
model: function(params) {
return this.store.createRecord('member', {
registrationKey: params.registrant_key,
email: this.get('email')
});
},
});
export default MembersNewRoute;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment