0

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.

0

1 Answer 1

1

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"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.