//= 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
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?