Reputation: 1902
my autocomplete functionality using the gem https://github.com/crowdint/rails3-jquery-autocomplete is not working. When I try to work with autocomplete in isolation (only one model) it works.
Here is my controller :-
autocomplete :location, :name
Model :-
belongs_to :location
View :-
= fields_for @event.location do |location|
= location.autocomplete_field :name, autocomplete_location_name_events_path, :placeholder => "Enter the name of the location"
routes :-
resources :events do
get :autocomplete_location_name, :on => :collection
end
application.js.cofee
#= require autocomplete-rails
I am not able to debug properly either as to know what exactly is the issue.
Upvotes: 0
Views: 326
Reputation: 329
Try
Routes:
get 'events/autocomplete_location_name'
View:
fields_for :location do |location|
location.autocomplete_field :name, events_autocomplete_location_name, :placeholder => "Enter the name of the location"
Upvotes: 1