1

重複の可能性

私のコードは非常に単純で、私のhtmlは次のとおりです。

<script type="text/x-handlebars" data-template-name="sites">
<ul>
    {{#each controller}}
    <li>
        {{#linkTo 'sites.index' site}} {{siteName}} {{/linkTo}}
    </li>
    {{/each}}
</ul>
</script>

私のEmberコード:

    WebApp.Router.map(function () {
    this.resource('sites', { path: '/' } , function() {
        this.route('index', { path: '/:site_id' })
    });
});


//returns all Sites to display
WebApp.SitesRoute = Ember.Route.extend({
    model: function () {
        return WebApp.Site.find();
    }
});



 WebApp.Site = DS.Model.extend({
      id: DS.attr('integer')
 });


WebApp.Site.FIXTURES = [
{
    id: 1,
    siteName: gff1.com
},
{        
    id: 2,
    siteName: gff2.com
},
{
    id: 3,
    siteName: gff3.com
}
];

へのリンクを含むサイトのリストを作成したい/sites/index/<ID> このコードを実行すると、Assertion failed: Cannot call get with 'id' on an undefined object. 何が間違っていますか?

4

1 に答える 1