Skip to content

Instantly share code, notes, and snippets.

@hampelm
Created August 3, 2012 23:30
Show Gist options
  • Save hampelm/3252667 to your computer and use it in GitHub Desktop.
Save hampelm/3252667 to your computer and use it in GitHub Desktop.
expansion
render: ->
$(this.el).html this.template()
bookHTML = for book in Books
(new BookView model: book).render().el
this.$('.book_list').append bookHTML
({
render: function() {
var book, bookHTML;
$(this.el).html(this.template());
bookHTML = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = Books.length; _i < _len; _i++) {
book = Books[_i];
_results.push((new BookView({
model: book
})).render().el);
}
return _results;
})();
return this.$('.book_list').append(bookHTML);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment