title: link_to_remove_association is not removing?
body: <p>How can we fix the nested_attribute: <strong>_result_fields.html.erb</strong> so that when a user clicks "Delete" that it actually deletes it? Whereas now clicking it does nothing.</p>
  
  <pre><code>&lt;%= f.text_field :result_value, class: 'form-control', placeholder: 'Enter Result' %&gt;
  &lt;%= f.date_select :date_value, :order =&gt; [:month, :day, :year], :with_css_classes =&gt; true, :class =&gt; "date-select" %&gt;
  &lt;%= f.check_box :bad %&gt;
  &lt;%= link_to_remove_association f do %&gt;
    Delete
  &lt;% end %&gt;
  </code></pre>
  
  <p>stats <code>has_many</code> results</p>
  
  <p><strong>stats/_form</strong></p>
  
  <pre><code>&lt;div id="results"&gt;
    &lt;%= f.fields_for :results do |result| %&gt;
    &lt;%= render 'result_fields', :f =&gt; result %&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  
    &lt;span class="label label-primary"&gt;
      &lt;%= link_to_add_association f, :results do %&gt;
      &lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; Result
      &lt;% end %&gt;
    &lt;/span&gt;
  </code></pre>
  
  <p>In <strong>stats_controller</strong> I have this as a params: <code>results_attributes: [:id, :result_value, :date_value, :bad, :_destroy]</code></p>
  
  <p>The <strong>models</strong>:</p>
  
  <pre><code>class Stat &lt; ActiveRecord::Base
    has_many :results
    accepts_nested_attributes_for :results, :reject_if =&gt; :all_blank, :allow_destroy =&gt; true
  end
  
  class Result &lt; ActiveRecord::Base
    belongs_to :stat
  end
  </code></pre>
  
  <p>I'm using the <a href="https://github.com/nathanvda/cocoon" rel="nofollow"><strong>cocoon gem</strong></a>.</p>
  
  <p>Please let me know if you need further code or explanation. Thank you!</p>
  
  <h2>BY REQUEST</h2>
  
  <pre><code>class StatsController &lt; ApplicationController
    before_action :set_stat, only: [:show, :edit, :update, :destroy, :like]
    before_action :logged_in_user, only: [:create, :destroy]
    before_action :correct_user, only: [:edit, :update, :destroy]
  
    def index
      if params[:tag]
        @stats = Stat.tagged_with(params[:tag])
      else
        @stats = Stat.joins(:results).all
        @averaged_stats = current_user.stats.averaged
        @instance_stats = current_user.stats.instance
      end
    end
  
    def show
      @stat = Stat.find(params[:id])
      @commentable = @stat
      @comments = @commentable.comments
      @comment = Comment.new
      @notable = @stat
      @notes = @notable.notes
      @note = Note.new
      @correct_user = current_user.stats.find_by(id: params[:id])
    end
  
    def new
      @stat = current_user.stats.build 
    end
  
    def edit
    end
  
    def create
      @stat = current_user.stats.build(stat_params)
      if (params[:commit] == 'conceal')
        @stat.conceal = true
        @stat.save
        redirect_to @stat, notice: 'Stat was successfully created'
      elsif
        @stat.save
        track_activity @stat
        redirect_to @stat, notice: 'Stat was successfully created'
      else
        flash.now[:danger] = 'Required Fields: "Averaged or Instance", "Enter Action", "Enter Metric", and "+ Result"'
        render 'new'
      end
    end
  
    def update
      if @stat.update(stat_params)
        redirect_to stats_url, notice: 'Goal was successfully updated'
      else
        render action: 'edit'
    end
  end
  
    def destroy
      @stat.destroy
      @result.destroy
      redirect_to stats_url
    end
  
    def like
      @stat = Stat.find(params[:id])
      @stat_like = current_user.stat_likes.build(stat: @stat)
      if @stat_like.save
        @stat.increment!(:likes)
        flash[:success] = 'Thanks for liking!'
      else
        flash[:error] = 'Two many likes'
      end  
        redirect_to(:back)
    end
  
    private
      def set_stat
        @stat = Stat.find(params[:id])
      end
  
      def correct_user
        @stat = current_user.stats.find_by(id: params[:id])
        redirect_to root_url, notice: "Not authorized to edit this stat" if @stat.nil?
      end
  
      def stat_params
        params.require(:stat).permit(:categories, :like, :action, :metric, :date, :comment, :private_submit, :tag_list, results_attributes: [:id, :result_value, :date_value, :bad, :_destroy])
      end
  end
  </code></pre>
  
  <p><strong>stat.js</strong></p>
  
  <pre><code>$( document ).ready(function() {
    $('.date-format-switcher').click(function(event){
      event;
      if ($(this).attr('id') == 'stat_categories_instance') {
        $('.day').show();
       } else if ($(this).attr('id') == 'stat_categories_averaged') {
          $('.day').hide();
      }
  })
    $('.add-form-padding').on('cocoon:after-insert', function(e, insertedItem) {
      if($('#stat_categories_instance').is(':checked')) {
        $('.day').show();
      } else {
          $('.day').hide();
      }
  })
  });
  </code></pre>