Skip to content

Instantly share code, notes, and snippets.

@lawrencepit
Created October 17, 2011 01:09
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 lawrencepit/1291689 to your computer and use it in GitHub Desktop.
Save lawrencepit/1291689 to your computer and use it in GitHub Desktop.
initialize: =>
@collection.bind('reset', @addAll)
addAll: =>
@collection.each(@addOne)
addOne: (post) =>
view = new Blog.Views.Posts.PostView(model : post)
@$("tbody").append(view.render().el)
render: =>
$(@el).html(@template(posts: @collection.toJSON()))
@addAll()
return this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment