From 1b919062503ef4651e41140fe4473c0985684f2c Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 15 Apr 2011 16:11:57 -0400 Subject: [PATCH] oops, have it use the view instead of the model --- spec/bin/backbone-generator_spec.rb | 1 + templates/collection_view.js.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/bin/backbone-generator_spec.rb b/spec/bin/backbone-generator_spec.rb index c3130e3..a91f9fb 100644 --- a/spec/bin/backbone-generator_spec.rb +++ b/spec/bin/backbone-generator_spec.rb @@ -46,6 +46,7 @@ describe 'backbone-generator' do File.file?(template = 'app/views/section/models.jst').should be_true File.read(view).should match(/SectionModelsView/) + File.read(view).should match(/SectionModelView/) File.read(view).should match(%r{template: JST\['section/models'\]}) File.read(spec).should match(/SectionModelsView/) end diff --git a/templates/collection_view.js.erb b/templates/collection_view.js.erb index 1a78172..742ce8f 100644 --- a/templates/collection_view.js.erb +++ b/templates/collection_view.js.erb @@ -13,7 +13,7 @@ var <%= object_name %>sView = Backbone.View.extend({ $(this.el).html(this.template()); }, addOne: function(model) { - var view = new <%= object_name %>({model: model}); + var view = new <%= object_name %>View({model: model}); this.$('.list').append(view.render().el); }, addAll: function() {