crowdint / rails3-jquery-autocomplete

An easy and unobtrusive way to use jQuery's autocomplete with Rails 3
http://rubygems.org/gems/rails3-jquery-autocomplete
MIT License
917 stars 367 forks source link

undefined is not a function #273

Closed creativetags closed 10 years ago

creativetags commented 10 years ago

I'm getting TypeError: undefined is not a function

here's an example:

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

kendrikat commented 10 years ago

Same here.

cforain commented 10 years ago

I can confirm this. Any workaround? Thanks.

pervel commented 10 years ago

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.

cforain commented 10 years ago

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.

bigtunacan commented 10 years ago

@cforain Did this work for you in production?

cforain commented 10 years ago

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

cforain commented 10 years ago

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 .

bigtunacan commented 10 years ago

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

kcc0 commented 10 years ago

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

simzen85 commented 10 years ago

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 ?