title: Replace ' with \' in Ruby?
body: <p>I'm trying to figure out how to replace a quote like <code>'</code> with something like <code>\'</code>.</p>
  
  <p>How would I do this? </p>
  
  <p>I have tried</p>
  
  <pre><code>"'".gsub("'","\\'")
  </code></pre>
  
  <p>but it just gives an empty string. What am I doing wrong here? </p>