Forum: Ruby on Rails page[].visual_effect problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4c2e3a5381459411d3ba43e7383505ed?d=identicon&s=25 Mark Studebaker (mstudebaker)
on 2007-02-24 02:35
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
6f76b08ca1bc3dc8e9b889cf026184f5?d=identicon&s=25 Jiin Park (tisphie)
on 2008-01-25 14:51
Mark Studebaker 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;
  },
This topic is locked and can not be replied to.