title: .autocomplete is not a function
body: <p>I am implementing the Jquery UI autocomplete. I have the following code. </p>
  
  <p><strong>Application.js</strong>  </p>
  
  <pre><code> $(function() {
          function log(message) {
              $( "&lt;div/&gt;" ).text( message ).prependTo("#log");
          }
  
          $("#tags").autocomplete({
              source : function(request, response) {
                  $.ajax({
                      url : "/projectlist",
                      dataType : "json",
                      data : {
                          style : "full",
                          maxRows : 12,
                          term : request.term
                      },
                      success : function(data) {
                          var results = [];
                          $.each(data, function(i, item) {
                              var itemToAdd = {
                                  value : item,
                                  label : item
                              };
                              results.push(itemToAdd);
                          });
                          return response(results);
                      }
                  });
              }
          });
      });
  </code></pre>
  
  <p><strong>Project Controller</strong></p>
  
  <pre><code> def project_list  
      list=Project.all.map{|i|i.project_name}
      arr= [].concat(list.sort{|a,b| a[0]&lt;=&gt;b[0]}).to_json
      render :json =&gt;arr
    end
  </code></pre>
  
  <p><strong>_form.html.erb</strong></p>
  
  <pre><code> &lt;input id = "tags"/&gt;
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>  match '/projectlist' =&gt; 'projects#project_list'
  </code></pre>
  
  <p>What my above code should do is, list projects. However I am getting the follwoing error in firebug. </p>
  
  <pre><code>$("#tags").autocomplete is not a function
  [Break On This Error] source : function(request, response) { 
  </code></pre>
  
  <p>I have also tried following the example <a href="http://jqueryui.com/demos/autocomplete/#remote-jsonp" rel="nofollow">JQuery Ui Autocomplete</a> and no luck and get the same error :S </p>