Skip to content

Instantly share code, notes, and snippets.

@selvagsz
Last active August 29, 2015 14:01
Show Gist options
  • Save selvagsz/609bc36e7cfa24c893de to your computer and use it in GitHub Desktop.
Save selvagsz/609bc36e7cfa24c893de to your computer and use it in GitHub Desktop.
Nested Route Url without nesting templates
var get = Em.get;
App.Router.map(function() {
this.route('something');
this.route('somethingelse', {path: '/somethingelse/:foo_id/:bar_id/:baz_id'});
});
App.SomethingelseRoute = Em.Route.extend({
model: function(params) {
//fetch the model
},
serialize: function(model) {
return {
foo_id: get(model, 'foo_id'),
bar_id: get(model, 'bar_id'),
baz_id: get(model, 'baz_id')
}
}
});
{{#link-to 'somethingelse' model_object_with_foo_bar_baz_ids}}Go to Something Else Route {{/link-to}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment