最佳答案
I'm looking at this Railscast episode and wondering why the call to escape_javascript
is needed here:
$("#reviews").append("<%= escape_javascript(render(:partial => @review)) %>");
What is escape_javascript
used for?
According to the Rails docs:
escape_javascript(javascript)
Escape carrier returns and single and double quotes for JavaScript segments.
But that doesn't mean much to me.