title: making an ajax call to controller action in rails
body: <p>I am trying to make an ajax call to my controller</p>
  
  <pre><code>class PatientRecordController &lt; ApplicationController
    def export
       ....
    end
  end
  </code></pre>
  
  <p>In my javascript file i have</p>
  
  <pre><code>$(document).ready(function(){
      freezeTopRow($('#dataTable'));
      $("#export").click(function(){
          $.ajax({url: "patient_record/export", type: "POST"});
      });
  });
  </code></pre>
  
  <p>when i inspect element and debug and when i click the export tag on my page. i hit the function however it never gets to the controller</p>
  
  <p>Also I have 2 controllers and 2 views.  In my other controller and view I do the same thing and it works</p>