title: using autocomplete in app with ransack
body: <p>Good day. 
  I hame a controller that uses ransack to find articles by their title.
  I need  field that's used for finding info  to use autocomplete.
  Currently it finds alright, but no autocomplete, could you assist me in that problem
  and gem <a href="https://github.com/crowdint/rails3-jquery-autocomplete-app" rel="nofollow">https://github.com/crowdint/rails3-jquery-autocomplete-app</a>?</p>
  
  <p>Gemfile</p>
  
  <pre><code> gem "ransack"
      gem 'rails3-jquery-autocomplete'
      gem 'nifty-generators'
      gem 'jquery-rails', '~&gt; 2.0'
  </code></pre>
  
  <p>in view:</p>
  
  <pre><code>&lt;%= search_form_for @q do |f| %&gt;
    &lt;%= f.label t('.find') %&gt;
    &lt;%= f.autocomplete_field :title_cont,
      articles_autocomplete_article_title_path, :size =&gt; 15 %&gt;&lt;br /&gt;
    &lt;%= f.submit :value=&gt;'Search', :class=&gt;'fl_right' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>head of layout: </p>
  
  <pre><code> &lt;%= stylesheet_link_tag    "application", :media =&gt; "all" %&gt;
    &lt;%= javascript_include_tag "application" %&gt;
        &lt;%= javascript_include_tag '/javascripts/jquery-ui-1.8.23.custom.min.js',
        '/javascripts/autocomplete-rails.js', '/javascripts/rails.js'  %&gt;
      &lt;%= stylesheet_link_tag '/stylesheets/ui-lightness/jquery-ui-1.8.23.custom.css' %&gt;
  </code></pre>
  
  <p>controller</p>
  
  <pre><code>class ArticlesController &lt; ApplicationController
    autocomplete :article, :title
  </code></pre>
  
  <p><strong>UPDATE 1</strong>
  and routes.rb</p>
  
  <pre><code>get 'articles/autocomplete_article_title'
  </code></pre>
  
  <p><strong>UPDATE 2</strong>
  in view , in place of  <code>&lt;%= f.autocomplete_field :title_cont,</code>
  used 
  1 ) :title_start no changes
  2) :articles_article_title_start and so on lead to errors.</p>
  
  <p><strong>UPDATE 3</strong>
  i've edited routes.rb. moved   get 'articles/autocomplete_article_title' into scope of locale variable, <strong>now it kind of works.</strong>.. autocomplete drop down list appears... but empty :( have to fix that one now.</p>
  
  <p><strong>UPDATE 4</strong>
  tried to use <a href="http://railscasts.com/episodes/102-auto-complete-association" rel="nofollow">http://railscasts.com/episodes/102-auto-complete-association</a>. but it's for older version of rails... and so on</p>
  
  <p><strong>UPDATE 5</strong>
  changed in routes.rb</p>
  
  <pre><code>  resources :articles do
      get 'autocomplete_article_title'
    end
  </code></pre>
  
  <p>No luck yet.</p>
  
  <p><strong>UPDATE 6</strong>
  As far as i understand current problem is: ransack &amp; autocomplete use one field.
  It's suitable for ransack  that field of autocomplete_field  type. but i don't know how to make field name acceptable by ransack work with autocomplete. Could you help?</p>
  
  <p><strong>UPDATE 7</strong>
  so in view  </p>
  
  <pre><code>   f.text_field :title_start,
        "data-autocomplete" =&gt; articles_autocomplete_article_title_path,
        :size =&gt; 15
  </code></pre>
  
  <p>in routes.rb</p>
  
  <pre><code>scope '(:locale)' do
    resources :users
    resources :news
    resources :articles do
  
    end
    get 'articles/autocomplete_article_title'
    get "news/index" , as: 'news'
  
  # match "/news*tail" =&gt; 'news#index'
    root :to =&gt; 'News#index', as: 'news'
  end
  </code></pre>