Skip to content

Instantly share code, notes, and snippets.

@MartinElvar
Created November 9, 2013 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinElvar/7388837 to your computer and use it in GitHub Desktop.
Save MartinElvar/7388837 to your computer and use it in GitHub Desktop.
App.User = DS.Model.extend({
name: DS.attr('string'),
email: DS.attr('string'),
createdDate: DS.attr(),
location: DS.attr('string')
});
App.User.FIXTURES = [{
id: 1,
name: "Johan",
email: "johan@gmail.com",
createdDate: new Date(),
location: "Sweden"
}];
App.UsersRoute = Ember.AuthenticationRoute.extend({
model: function() {
return this.store.find('user');
}
});
<ul>
{{#each user in controller}}
<li>{{user.name}}</li>
{{else}}
<li>No users</li>
{{/each}}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment