title: No route matches [POST] - Sending data to Ruby on Rails
body: <p>I'm trying to send data to my Ruby on Rails application via an AJAX POST request.
  This works fine on the index page where it just accepts the POST request and takes the parameter for usage like <code>params[:MyParam]</code>, however when trying to do the <strong>exact</strong> same thing in my <code>show</code> action, I get the error:</p>
  
  <blockquote>
    <p>No route matches [POST]</p>
  </blockquote>
  
  <p>I'm sending the POST request like so:</p>
  
  <pre><code> &lt;% if !params[:recData] %&gt;
  var PostDone = false;
   &lt;% end %&gt;
   $(document).ready(function() {
     $.post(document.URL, { recData: "POST REQUEST!" }, function(response) { 
    if(PostDone == false) {
      document.write(response);
      PostDone = true;
    }
    });
   });
  </code></pre>
  
  <p>I'm kind of new to AJAX and Rails, so a helping hand would be much appreciated.</p>