You're commenting out the JavaScript--which executes on the client side.
The partial rendering happens on the server side, before the client ever sees the rendered JavaScript.
In other words, commenting out JavaScript has zero effect on the server-side processing. If you don't want the server-side string to be displayed, comment it out:
<%#= escape_javascript(etc) %>
Let's assume the partial renders like this:
<h1>Foo bar baz</h1>
<div>Plugh!</div>
Escaping this for JavaScript will turn the newline into a \n
(and would escape single- and double-quotes, etc.) leaving you with this on the client side:
$('#show').html('<h1>Foo bar baz</h1>\n<div>Plugh!</div>');
Whether or not the JS is commented out or not, the partial is going to render unless you comment out the results of the escape_javascript
Ruby code.
On the client side, if the JS is commented out, it shouldn't update show
's HTML--are you saying it is?