Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to test jquery autocomplete in rails that isn't responding
    primarykey
    data
    text
    <p>I'm trying to use rails3-jquery-autocomplete gem on OSX 10.7, Rails 3.1.0, Ruby 1.9.2-p290</p> <p>I just set up a pretty blank app to find out why I cant get it to work. I don't get any error messages but nothing is appearing. I don't know what to fix.</p> <p>Here's what I have:</p> <pre><code> &lt;head&gt; &lt;title&gt;Usewith&lt;/title&gt; &lt;%= stylesheet_link_tag "application" %&gt; &lt;%= javascript_include_tag "application" %&gt; &lt;%= javascript_include_tag "autocomplete-rails.js" %&gt; &lt;%= csrf_meta_tags %&gt; &lt;/head&gt; </code></pre> <p>ItemsController</p> <pre><code>class ItemsController &lt; ApplicationController # GET /items # GET /items.json autocomplete :category, :name </code></pre> <p>Routes.rb</p> <pre><code>Usewith::Application.routes.draw do resources :items do get :autocomplete_category_name, :on =&gt; :collection end resources :categories </code></pre> <p>items/_form.html.erb</p> <pre><code> &lt;div class="field"&gt; &lt;%= f.label :category_id %&gt;&lt;br /&gt; &lt;%= f.collection_select :category_id, Category.all, :id, :name %&gt; &lt;%= f.autocomplete_field :category_name, autocomplete_category_name_items_path %&gt; &lt;/div&gt; </code></pre> <p>Item model contains category_id:integer, category_name:string</p> <p>Any help on where to start looking?</p> <p>EDIT I receive this error in Chrome console</p> <blockquote> <p>Uncaught TypeError: Object [object Object] has no method > 'autocomplete' jQuery.railsAutocomplete.fn.extend.init autocomplete-rails.js:53 jQuery.railsAutocomplete autocomplete-rails.js:35 jQuery.fn.railsAutocomplete autocomplete-rails.js:28 liveHandlerjquery.js:3689 jQuery.event.handle jquery.js:2966 jQuery.event.add.elemData.handle.eventHandle jquery.js:2600 jQuery.event.triggerjquery.js:2894 handler jquery.js:3420</p> </blockquote> <p>autocomplete-rails.js:53</p> <pre><code>$(e).autocomplete({ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload