-
-
Save jhsu/05a001618d3ecfe493a1 to your computer and use it in GitHub Desktop.
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.Router.map(function() { | |
this.resource('members', {path: '/members'}, function() { | |
this.resource('member', {path: '/:member_id'}, 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
App.MemberRoute = Ember.Route.extend({ | |
model: function(params) { | |
// this gets hit first, params.member_id is available | |
return this.store.find('member', params.member_id); | |
} | |
}); | |
App.MemberIndexRoute = Ember.Route.extend({ | |
model: function(params) { | |
// this gets hit second | |
// here, params.member_id is null | |
return this.modelFor("member"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment