[Rails] RJS templates for DOM manipulation

Pedro Côrte-Real pedro at pedrocr.net
Fri Aug 18 09:17:55 GMT 2006


I want to do some DOM manipulation with JavaScript. Specifically I
want to implement zoom in/out in a picture by changing it's
width/height attributes. Is it possible to do this using RJS or should
I write javascript by hand?

All the examples of RJS I've seen write the javascript in the result
of an AJAX remote call. Where are the docs for RJS? All I've seen are
blog posts.

I don't want to do any roundtrips to the server, but just have some
links that trigger functions. I've seen link_to_function so all I'm
missing is a way to write the javascript functions themselves in RJS.
Does it have functions so set/get stuff from the DOM? Should it be
used like this at all?

Thanks,

Pedro.


More information about the Rails mailing list