2012-09-22 4 views
0

내 자동 완성 기능이 보석 https://github.com/crowdint/rails3-jquery-autocomplete을 사용하여 작동하지 않습니다. 내가 단독으로 (하나의 모델 만) 자동 완성 기능을 사용하려고하면 작동합니다. 여기 rails-3-jquery 자동 완성이 중첩 모델과 함께 작동하지 않습니다.

내 컨트롤러입니다 : -

autocomplete :location, :name 

모델 : -

belongs_to :location 

보기 : -

= fields_for @event.location do |location| 

    = location.autocomplete_field :name, autocomplete_location_name_events_path, :placeholder => "Enter the name of the location" 

경로 : -

resources :events do 
    get :autocomplete_location_name, :on => :collection 
end 
,

application.js.cofee는

#= require autocomplete-rails 

나는 정확히 문제가 무엇인지 알고 제대로 중 하나로 디버깅 할 수 없습니다입니다.

+0

저도 같은 문제가 있습니다. 해결책을 찾았습니까? – Jayaram

답변

1

노선을 시도합니다

get 'events/autocomplete_location_name' 

보기 :

fields_for :location do |location| 
location.autocomplete_field :name, events_autocomplete_location_name, :placeholder => "Enter the name of the location" 
관련 문제