title: Rails escape_javascript creates invalid JSON by escaping single quotes
body: <p>The escape_javascript method in ActionView escapes the apostrophe <code>'</code> as backslash apostrophe <code>\'</code>, which gives errors when parsing as JSON.</p>
  
  <p>For example, the message "I'm here" is valid JSON when printed as:</p>
  
  <pre><code>{"message": "I'm here"}
  </code></pre>
  
  <p>But, <code>&lt;%= escape_javascript("I'm here") %&gt;</code> outputs <code>"I\'m here"</code>, resulting in invalid JSON:</p>
  
  <pre><code>{"message": "I\'m here"}
  </code></pre>
  
  <p>Is there a patch to fix this, or an alternate way to escape strings when printing to JSON?</p>