Page[].visual_effect problem

Hi…

I don’t know what I’m doing wrong but I can’t seem to get this code to
work:

page[:invite].replace_html @message
page[:invite].visual_effect(:Highlight)

But this works:

page.replace_html(“invite” , @message)
page.visual_effect( :highlight, “invite”)

This is the error I get:
$(“invite”).update(“user already belongs to your group.”);
$(“invite”).visualEffect(:Highlight");

Seems llike they both should work.

Any help would be great.

  • Mark

Mark S. wrote:

Hi…

I don’t know what I’m doing wrong but I can’t seem to get this code to
work:

page[:invite].replace_html @message
page[:invite].visual_effect(:Highlight)

Any help would be great.

  • Mark

I got same problem.

So I tried to change effect.js,

you can find keyword ‘visualEffect’, and change like below.

visualEffect: function(element, effect, options) {
element = $(element)
if (effect.startsWith(‘toggle_’)) {
var s = effect.gsub(/toggle_/, ‘’)
Effect.toggle(element, s);
} else {
var s = effect.dasherize().camelize(), klass =
s.charAt(0).toUpperCase() + s.substring(1);
new Effect[klass](element, options);
}
return element;
},