diff --git a/templates/app_helper.coffee.erb b/templates/app_helper.coffee.erb index 686bd70..73ba134 100644 --- a/templates/app_helper.coffee.erb +++ b/templates/app_helper.coffee.erb @@ -4,8 +4,8 @@ Backbone.Collection.prototype.ensureFetched = (callback) -> this.unbind('refresh', _refresher) callback.apply(this) @_alreadyEnsureFetched = true - @bind('refresh', _refresher) - @fetch() + this.bind('refresh', _refresher) + this.fetch() else callback.apply(this) diff --git a/templates/collection_view.coffee.erb b/templates/collection_view.coffee.erb index a27919b..a99b2a9 100644 --- a/templates/collection_view.coffee.erb +++ b/templates/collection_view.coffee.erb @@ -4,10 +4,7 @@ class window.<%= plural_object_name %>View extends Backbone.View } template: JST['<%= plural_underscore_name %>/list'] initialize: -> - @collection.bind('refresh', @addAll) - - this.render() - @collection.fetch + @collection.bind('refresh', this.addAll) render: => $(this.el).html(this.template()) this