title: Save data using AJAX and CakePHP
body: <p>I've spent today researching how to save data using an ajax request in cakephp and have got now where, the documentation on the cakephp website seems a bit lacking for this particular topic.</p>
  
  <p>I have several sortable lists and I need to save the position of each list item when one is sorted. I have an ajax request set up as follows that is triggered when an item is moved:</p>
  
  <pre><code>$.ajax({                    
          url: "/orders/save_column_order",
          type:"POST",                                        
          data:"data="+data
         });
  </code></pre>
  
  <p>and the referenced function in the controller is:</p>
  
  <pre><code>function save_column_order(){
      if($this-&gt;RequestHandler-&gt;isAjax()){
  
               SAVE STUFF...
  
          }
    }
  </code></pre>
  
  <p>I have the helpers etc. set up:</p>
  
  <pre><code>var $helpers = array('Html','Form','Js');
  var $components = array('Session','Email','RequestHandler');
  </code></pre>
  
  <p>And its not working...</p>
  
  <p>So my questions are:</p>
  
  <p>1) What is the current url for sending an ajax request to an action in a controller? Is it simply /controller/action?</p>
  
  <p>2) What else do I need to do to the controller to access the ajax data?</p>
  
  <p>BONUS:</p>
  
  <p>3) Is there a way to include a custom php file in the CakePHP framework that references the database settings so I can manually update my mysql database?</p>