rails-3-jquery autocomplete not working with nested models

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.

Answers


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"

Need Your Help

how to print the lines of a file that are multiples of 3 like 3rd, 6th, 9th line etc

unix

I have a file and I want only lines that are multiples of 3. Is there any UNIX command to perform this task?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.