2
votes

I am trying to build a simple master-detail Ember app but having a hard time with the latest version of the Ember routing model. I've boiled down an example that is just a list of favorites and a list of (hard-coded) attributes. When the user clicks on the favorite, they should be shown the list of attributes, that's all. No intermediate edit step. Getting the dynamic model set up is what is most confusing.

I could not find any examples that matched exactly what I was trying, but this is my best shot:

App.Router.map(function(){
    this.resource('favorites', {path:'/favorites'}, function(){
        this.route('attribs', {path:'/:fav_id/attribs'});
    });
});

This jsfiddle shows where I am right now. For some reason it does not react at all to clicking on the attribs link, which should cause the attribs template to display. For all I know it only needs a line changed but all of my attempts have failed to get a result.

1

1 Answers

2
votes

The first problem I can see is that your App.AttribsRoute needs to be named App.FavoritesAttribsRoute (since Attribs is nested under Favorites).

It looks like making that change causes that route to be entered - I'm unable to get that template to render though yet.