Skip to content

Instantly share code, notes, and snippets.

@archit
Last active August 29, 2015 14:21
Show Gist options
  • Save archit/9188045a5ecdb03b9f73 to your computer and use it in GitHub Desktop.
Save archit/9188045a5ecdb03b9f73 to your computer and use it in GitHub Desktop.
Router.map(function() {
this.route('emulate', { path: '/emulate' }, function() {
this.route('show', { path: '/:my_model_id' });
});
});
export default Ember.Route.extend({
model: function(params) {
if (params.my_model_id) {
return this.store.find("my-model", params.my_model_id);
} else {
return this.store.createRecord("my-model");
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment