title: rails xhr.send( ( options.hasContent && options.data ) || null ); error
body: <p>I trying to make like button for each recipe </p>
  
  <p>but if i click like button browser said </p>
  
  <p>xhr.send( ( options.hasContent &amp;&amp; options.data ) || null );</p>
  
  <p>return this errors</p>
  
  <p>I don't know why this error occurred</p>
  
  <p>this is my code in rails </p>
  
  <p><code>application.js</code></p>
  
  <pre><code>function like(id){
      $.ajax({
          url:"/like/" + id,
          type:"POST",
          dataType:"json",
          success: function(data){
              if(data.result){
                  $("#countlike").html("likes " + data.count);
                  // $("#count").removeAttr('onclick');
                  // $("#count").attr('disabled', 'disabled');
              }
          }
      });
  }
  </code></pre>
  
  <p><code>route.rb</code></p>
  
  <pre><code>post '/like/:id'=&gt;'recipes#like' 
  </code></pre>
  
  <p><code>views/recipes/show.html.erb</code></p>
  
  <pre><code>&lt;p&gt;
    &lt;a id = "countlike" onclick="like(&lt;%=@recipe.id%&gt;)"&gt;Like it&lt;/a&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p><code>recipes_controller.rb</code></p>
  
  <pre><code>  def like
        likes = Recipe.find(params[:id]).likes           
        result = likes.create 
        render json:{result: result, count: likes.count}
    end
  </code></pre>
  
  <p>It was work correctly in other project same code</p>