escape_javascript(javascript)
Instance Public methods
Escapes carriage returns and single and double quotes for JavaScript segments.
Also available through the alias j(). This is particularly helpful in JavaScript responses, like:
$('some_element').replaceWith('<%=j render 'some/element_template' %>');
Please login to continue.