title: "Ajax is not found" exception - is Rails defaulting to Prototype by mistake?
body: <p>I am trying to create a page that shows a list of tasks and allows the user to update task status by checking a checkbox. </p>
  
  <p>When I run the page on the browser and click on the checkbox, I get a Javascript Exception "</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: Ajax is not
    defined (anonymous function)2:96
    onclick</p>
  </blockquote>
  
  <p>Here is the code that I have on my _task.html.erb file:</p>
  
  <pre><code>&lt;%= check_box_tag "id", "id", task.done, 
      :onclick =&gt; remote_function(
        :update =&gt; "task", 
        :url =&gt; { :action =&gt; :update }, 
        :with =&gt; "'done=true'", 
        :complete =&gt; "alert('hi')"  ) %&gt;
  </code></pre>
  
  <p>Why am I getting this <em>Ajax is not defined</em> exception?</p>
  
  <p>I reinstalled rails jquery, ensure that there is a rails.js and a jquery.js in the javascripts folder and confirmed they are loading on the HTML, see below:</p>
  
  <pre><code>&lt;script src="/javascripts/jquery.js?1303396383" type="text/javascript"&gt;&lt;/script&gt; 
  &lt;script src="/javascripts/rails.js?1303562965" type="text/javascript"&gt;&lt;/script&gt; 
  &lt;script src="/javascripts/application.js?1301606933" type="text/javascript"&gt;&lt;/script&gt; 
  &lt;script src="/javascripts/jquery.purr.js?1302145859" type="text/javascript"&gt;&lt;/script&gt; 
  &lt;script src="/javascripts/best_in_place.js?1302150372" type="text/javascript"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>Someone posted a comment saying that "Ajax" with capital A is a prototype function rather than a rails function. Is my application somehow configured to try to use Prototype rather than rails? While files do I need to change to fix this?</p>
  
  <p>I just tried changing config/application.rb and uncommented this line: </p>
  
  <pre><code>config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
  </code></pre>
  
  <p>Didn't seem to work either. Any idea?</p>
  
  <p>Thanks a lot for your help.</p>