I am really new to backbone so any help on this would be awesome, even just to point me in the direction of some resources related to this.
I have tried to create a fiddle but it won't work the same as on my machine: http://jsfiddle.net/Wh2H5/
Basically what I need to do is render the array of objects(see the image below) as parts of the template.
This is the view I am rendering:
var ListView = Backbone.View.extend({
tagName: 'ul',
className : 'nav nav-list',
initialize: function() {
this.collection.bind('all', this.render,this);
this.template = _.template($('#item-list').html());
},
render:function (eventName) {
$(".bike_list ul").empty();
this.collection.each(function(bike){
this.$el.append(this.template(bike.toJSON()));
},this);
return this;
}
});
So to see the problem copy the code from this fiddle and paste it to a html document.