rails new store-backend
gem 'spree_backend', github: 'spree/spree'
exercise.Activities = Backbone.Collection.extend({ | |
model: exercise.Activity, | |
url: "exercise.json", | |
comparator: function(activity){ | |
var date = new Date(activity.get('date')); | |
return date.getTime(); | |
} | |
}); |
exercise.ActivityListView = Backbone.View.extend({ | |
tagName: 'ul', | |
id: 'activities-list', | |
attributes: {"data-role": 'listview'}, | |
initialize: function() { | |
this.collection.bind('add', this.add, this); | |
this.template = _.template($('#activity-list-item-template').html()); | |
}, | |
exercise.ActivityListView = Backbone.View.extend({ | |
tagName: 'ul', | |
id: 'activities-list', | |
attributes: {"data-role": 'listview'}, | |
initialize: function() { | |
this.collection.bind('add', this.render, this); | |
this.template = _.template($('#activity-list-item-template').html()); | |
}, | |