Flowdock
escape_javascript(javascript) public

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' %>');
Show source
Register or log in to add new notes.