0

gem https://github.com/crowdint/rails3-jquery-autocompleteを使用したオートコンプリート機能が機能していません。オートコンプリートを単独で (1 つのモデルのみ) 使用しようとすると、機能します。

これが私のコントローラーです:-

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

アプリケーション.js.コーヒー

#= require autocomplete-rails

問題が正確に何であるかを知るために、適切にデバッグすることもできません。

4

1 に答える 1

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"
于 2013-01-18T17:53:34.330 に答える