I'm using this gem in my rails 4 application for autocompletion. I've followed the example very closely but have had no luck.
First I required these in my application.js is this enough or do I need to go and download jQuery UI? I have jquery-rails gemmed and in my public/javascripts folder have jquery.js jquery.min.js, and jquery_ujs.js files but no jquery.ui files.
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require autocomplete-rails
Next in my reviews controller (artist has a field called name):
class ReviewsController < ApplicationController
autocomplete :artist, :name
in routes:
resources :reviews do
get :autocomplete_artist_name, :on => :collection
end
and in my review form view:
<%= form_for(@review) do |f| %>
<%= f.autocomplete_field :artist, autocomplete_artist_name_reviews_path %>
When I try to type in artist names that already exist in my database, into the artist field of a review, nothing is autocompleted. I cleared browser history first to remove browser autocompletion and there is nothing working with the gem. I've spent a lot of time trying to figure this out and haven't got anywhere. Is it because my review has a field that is named artist as well?