I'm trying to figure out how to fetch data with Ember Data and render. After several problems I got to this point where I get no error on the console but the store is empty after the data is loaded.
window.App = Ember.Application.create();
App.IndexRoute = Ember.Route.extend({
model: function(){
return this.store.find('games');
}
});
App.GamesModel = DS.Model.extend({
name: DS.attr('string')
});
App.GamesAdapter = DS.RESTAdapter.extend({
host: 'http://private-0f6a1-ember37.apiary-mock.com'
});
App.GamesSerializer = DS.RESTSerializer.extend({
normalizePayload: function(payload){
var result = { games: payload };
return result;
}
});
And this is the template:
<script type="text/x-handlebars" data-template-name="index">
<ul>
{{#each model}}
<li>{{name}}</li>
{{/each}}
</ul>
</script>
Here is the link for the code on CodePen: http://codepen.io/tarmann/pen/GJMJxq
I also tried different versions of Ember Data and Ember but with no luck.

Added from controllerdisplayed correctly on CodePen.