I am trying to use nested routing to render a collection. After rendering the collection, clicking on an element (using a link) displays that particular element in a socket. All of this works great so far.
I had a problem when refreshing the page does not cause the "model" of my sub-resource to bind.
From the Ember website at http://emberjs.com/guides/routing/specifying-a-routes-model/ :
What happens if a user visits your application directly with a URL that contains a dynamic segment? For example, they can reload or send the link to a friend who clicks on it. In this case, because we are starting the application from scratch, the JavaScript model object was displayed; all we have is an id from the url.
Fortunately, Ember will extract any dynamic segments from the url for you and pass them as a hash to the model hook as the first argument
Here is my code:
Admin.Workqueues.App.Router.map(function () {
this.resource('delinquencies', function () {
this.resource('delinquency', {
path: '/:id'
});
});
});
Admin.Workqueues.App.DelinquenciesRoute = Ember.Route.extend({
model: function () {
}
});
Admin.Workqueues.App.DelinquencyRoute = Ember.Route.extend({
model: function (params) {
debugger;
}
});
Thus, with this code, the entire collection is displayed in / delinquencies . Clicking on an element opens the delay object in / delinquencies / 3 , but now updating the page does not cause the model of the extension route to be linked.
I'm not sure what I am missing. Any ideas? If that matters, I use:
: 1.2.0
Ember: 1.0.0-beta.7 + canary.f482da04
: 1.1.1