deb
deb

Reputation: 12814

Jquery toggle() and highlight() not working in rails 3 call back

I have a form that is submitted via ajax in a rails 3 app. The form works, the record is updated, but the jquery code in update.js.erb is not working. It is simply:

$('#item').toggle().highlight();

I get a ".toggle().highlight(); is not a function" error in firebug

I recently upgraded from rails 2.3.8 to rails 3, and I think this was working before.

Do I need to included jquery and jquery.ui again in the update.js.erb template?


Update

It turns out I need to change .highlight(); to .effect("highlight", {}, 3000); and it now works

Upvotes: 1

Views: 1768

Answers (1)

eveevans
eveevans

Reputation: 4460

are you using only jQuery? or are you calling to prototype, in that case you have to include jquery with compatible mode, and call it like:

jQuery('#item').toggle().highlight();

Upvotes: 2

Related Questions