crowdint/rails3-jquery-autocomplete

undefined is not a function

creativetags opened this issue · 10 comments

I'm getting TypeError: undefined is not a function

here's an example:

http://jsbin.com/dilefeko/1/edit?html,console,output

Same here.

I can confirm this. Any workaround? Thanks.

You are probably missing jQuery UI which is no longer part of jquery-rails. You need to install and require the gem jquery-ui-rails explicitly in Gemfile, application.js, and application.css.

Well, I already had jquery-ui installed, but (at least in development) what solved the issue for me was deleting de assets and reordering the requirements on application.js , placing the autocomplete right after jquery-ui. I am yet to test it on production.

@cforain Did this work for you in production?

I will let you know as soon as I run it in production. Did mys solution work for you in development?

I can confirm that my workaround worked on production. Here is a snippet od my application.js :

//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require jquery.datepick
//= require jquery.datepick-pt-BR
//= require autocomplete-rails
//= require masked_input
//= require active_scaffold
//= require defaults
//= require_tree .

Thanks for the update. I'm going to mark this as closed; sounds like just a change to jQuery.

kcc0 commented

Thank you for this tip. Saved me a lot of time.

With the latest version of jquery-rails, the line to include Jquery UI became //= require jquery-ui instead of //= require jquery.ui.all

It seems that the issue comes back again. Can someone take a look with this ?