Hello all,
I have a tricky issue with escape_javascript and render/render_to_string
I’m looking for some comments on. Brief background, I’m making a gmaps
interface and am trying to render a partial to a string in my controller
so I can pass it through to my maps object (a library) for handling.
To make this work I need to escape the text returned by the template.
However, I can’t do this right before passing it to the object, since
escape_javascript is only available in the view.
My next thought was to define a container template that did nothing but
escape the content, e.g.:
<%= escape_javascript render_to_string :partial => ‘inner_template’ %>
The problem with this is that render_to_string is only available to the
controller. So, I can’t escape after the fact, or render a string in
the
template, where I could escape it.
Anyone solved this short of re-implementing escape_javascript and making
that available to the controller?
Thanks as always for the help,
pt.
Parker T.
Professional
(w) http://placesite.com
© 510.541.0125