Re: RJS: How to create an observer?

Alex W. wrote:

Michael S. wrote:

page << “new Form.Element.Observer(‘my_select_element’,” +
" function(element, value) { … });"

I think the standard helpers are available in RJS templates so you can
probably just do:

page << observe_field(:foo, options_hash)

observe_field wraps tags around the code it generates and I
don’t think they belong in a text/javascript response.