title: Ember.js Uncaught TypeError: Cannot read property 'handler' of undefined
body: <p>I am trying to implement a dynamic form in Ember. I want the user to be able to select an option from a dropdown and add it to the form. Also each added field should have an "x" that deletes the element from the form. </p>
  
  <p>I've put together something that seems to work <a href="http://jsfiddle.net/CzbuM/3/" rel="nofollow">(JSFiddle)</a> but whenever an added form element is deleted (the x next to it is clicked), I get an error in the console that says: "Uncaught TypeError: Cannot read property 'handler' of undefined". </p>
  
  <p>I think it may have something to do with the handlebars "action" helper that is attached to the "a" tag. I'm not sure though.</p>
  
  <p>Here is a sample of the delete function that is called when the "x" next to the inserted input element is clicked. </p>
  
  <pre><code>        deleteOption: function (event) {
          this.removeChild(event);
          this.rerender();
          },
  </code></pre>
  
  <p>and here is the template for the "newOption" view that is used when a new input element is added (after clicking the "+" button)</p>
  
  <pre><code>    &lt;script type="text/x-handlebars" data-template-name="newOption"&gt;
      &lt;p&gt;
        &lt;label {{bindAttr for="view.name"}}&gt;{{view.label}}&lt;/label&gt;
        &lt;br /&gt;&lt;input class="input-medium option" {{bindAttr id="view.name" name="view.name"}} type="text" maxlength="5"  /&gt;
        &lt;a href="#" class="delete addsub" {{bindAttr id="view.name"}} {{action deleteOption view target="view.parentView" }}&gt;X&lt;/a&gt;
      &lt;/p&gt;
    &lt;/script&gt;
  </code></pre>