Forum: Ruby on Rails onmousover Element

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
419c9cc258895bed66c89892721c2971?d=identicon&s=25 Elliott Blatt (eblatt)
on 2007-07-16 19:41

I'm a little baffled.  I'm trying to swap the CSS class when a user
mouses over/out of a link.  The idea seems simple enough, but I'm
getting what seems to be a incorrect error message from Fireboug.

Here's the error message:
$("section-one").toggleClassName is not a function

It's as if protoype is not loaded, which it is.

Here the code:

<%= link_to_remote 'Show',
   {:url => {:controller => :dashboard ,
             :action => 'show' ,
             :id => } },
{:class => 'workspaceNav',
 :onmouseover =>  "$('section-three').toggleClassName('workspace-index-
 :onmouseout => "$('section-three').toggleClassName('workspace-index-ite
m-container-selected')" }

I've also tried the following:

 <%= link_to_remote 'Do',
                { :url => {:controller => :dashboard ,
                         :action => 'do' ,
                         :id => }},
                { :class => 'workspaceNav',
                  :onmouseover =>
                 :onmouseout => "Element.toggleClassName('section-two',
'workspace-index-item-container-selected')" }
This topic is locked and can not be replied to.