title: Remove Item from Array in Meteor.js
body: <p>I have a collection called Rulesets - each ruleset has an array of "rules". I have the following html which displays each ruleset and each rule:</p>
  
  <pre><code>&lt;template name="rulesets"&gt;
      {{#each rulesets}}
          {{&gt;rulesetSingle}}
      {{/each}}
  &lt;/template&gt;
  
  &lt;template name="rulesetSingle"&gt;
      {{#each rules}}
           &lt;p class="rule-description"&gt;{{this}}
               &lt;a href="#" class="rule-delete-btn"&gt;x&lt;/a&gt;
           &lt;/p&gt;
      {{/each}}
  &lt;/template&gt;
  </code></pre>
  
  <p>I want to be able to remove the rule when the user clicks the "rule-delete-btn".<br>
  I have the following javascript to do this:</p>
  
  <pre><code>Template.rulesetSingle.event({
      'click .rule-delete-btn': function(e){
          e.preventDefault();
          var array = Rulesets.rules;
          var index = array.indexOf(this);
          array.splice(index, 1);
      }
  });
  </code></pre>
  
  <p>The delete isn't working because the "array" declaration isn't pulling a valid array. How can I find and store the array that contains "this" which is the current rule that needs to be deleted?</p>