Link_to_remote for a div

Hi,

i just want to create with Ror an event when a the mouse is over an
element. Is there any helper function like link_to_remote that
generates the code…
I need something like this

Some text

Thanks

cfingerh,

i just want to create with Ror an event when a the mouse is over an
element. Is there any helper function like link_to_remote that
generates the code…

You are close: look at ‘link_to_remote’ source
http://caboo.se/doc/classes/ActionView/Helpers/PrototypeHelper.html#M005056
, and you’ll see that it calls ‘remote function’
http://caboo.se/doc/classes/ActionView/Helpers/PrototypeHelper.html#M005063

In the view :

<a onmouseover="<%= remote_function(:url => { :action => :bar }) %>"

foo

In the controller:

def bar
render(:update) { |page|
page.alert(‘bar’)
}
end

Alain

blog.ravet.com

When would doing something like that be useful or better than just
embedding
the javascript?

Maybe if the stuff that you’d be mousing over was dynamic rather than
static?

Just curious.

On 5/10/07, Alain R. [email protected] wrote:

http://caboo.se/doc/classes/ActionView/Helpers/PrototypeHelper.html#M005056

Alain

blog.ravet.com


Terry (TAD) Donaghe

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs