I am new to highways and mustaches. I am trying to load a basic collection (an array of objects) to load a page from a rails json object to save an extra call. I'm having trouble rendering the collection using a mustache template.
My model and collection
var Item = Backbone.Model.extend({ }); App.Collections.Items= Backbone.Collection.extend({ model: Item, url: '/items' });
and browse
App.Views.Index = Backbone.View.extend({ el : '#itemList', initialize: function() { this.render(); }, render: function() { $(this.el).html(Mustache.to_html(JST.item_template(),this.collection ));
In the above rendering view, I can display one model (commented out test object), but not collections. I am completely amazed here, I tried both with underlining patterns and with a mustache, but no luck.
And this is the Template
<li> <div> <div style="float: left; width: 70px"> <a href="#"> <img class="thumbnail" src="http://placehold.it/60x60" alt=""> </a> </div> <div style="float: right; width: 292px"> <h4> {{name}} <span class="price">Rs {{price}}</span></h4> </div> </div> </li>
and my array of objects looks like this:

source share