title: Uncaught TypeError: this.model.toArray is not a function
body: <p>Im trying to print the edit and delete button with the data that's been added.</p>
  
  <p>Model:</p>
  
  <pre><code>var Food = Backbone.Model.extend({
  
      defaults: {
          fooddisplay: '',
          quantity: '',
          url: ''
      }
  
  });
  </code></pre>
  
  <p>Collection:</p>
  
  <pre><code>var Foods = Backbone.Collection.extend({
  
  });
  
  
  /*var f1 = new Food({
      fooddisplay: 'bonay',
      quantity: 'poultry\'s',
      url: 'http://eggpoultry.com'
  });
  
  var f2 = new Food({
      type: 'manok',
      quantity: 'two manok\'s',
      url: 'http://heneralmanok.com'
  });*/
  
  var fs = new Foods();
  </code></pre>
  
  <p>View:</p>
  
  <p>UPDATE: Everything's working fine now</p>
  
  <pre><code>var FoodView = Backbone.View.extend({
      model: new Food(),
      tagName: 'tr',
      initialize: function() {
          this.template = _.template($('.food-list-temp').html());
      },
      render: function() {
          this.$el.html(this.template(this.model.toJSON()));
          return this;
  
      }
  });
  
  var FoodsView = Backbone.View.extend({
      model: Foods,
      el: $('.food-list'),
      initialize: function() {
          this.model.on('add', this.render(), this);
      },
      render: function() {
          var self = this;
          this.$el.html('');
          this.model.each(function(food) {
              self.$el.append((new FoodView({model: food})).render().$el);
          });
          return this;
      }
  });
  
  var FoodsView = new FoodsView();
  </code></pre>
  
  <p>Add function:</p>
  
  <pre><code>$(document).ready(function() {
      $('.add-food').on('click', function() {
          var f = new Food({
              fooddisplay: $('.fooddisplay-input').val(),
              quantity: $('.quantity-input').val(),
              url: $('.url-input').val()
          });
          console.log(f.toJSON());
          f.add(fs);
      });
  });
  </code></pre>
  
  <p>The problem is, it says this.model.toArray is not a function. I dont know what i did wrong here. Thanks in advance if you answer greatest programmers in the world.</p>