title: Rails email double escaping single quotes
body: <p>I have a mailer in rails for a number of different emails, one of which is sent to notify users that another user has commented on something. </p>
  
  <p>When the email is generated, it includes the content of the comment, so I need to ensure that the comment is escaped, which rails is doing for me by default just like in all views. This is great, but when it comes to a single quote such as apostrophe's in words, it seems to be getting double escaped. The email I receive, shows</p>
  
  <pre><code>„ It&amp;#x27;s all about the quotes isn&amp;#x27;t it. “
  </code></pre>
  
  <p>And if I inspect the HTML of the email in the rails log, it shows that the HTML produced is</p>
  
  <pre><code>„ It&amp;amp;#x27;s all about the quotes isn&amp;amp;#x27;t it. “
  </code></pre>
  
  <p>So it's being escaped correctly, but then something is escaping it a second time.
  My view is an <code>html.haml</code> file.</p>
  
  <p>I've tried outputting the content with the <code>raw</code> command but it didn't make a difference so I'm pretty confused as to what's going on. I know in rails 3.2.8 they changed the escaping of single quotes, so I am expecting to see the &#x27; but not the &amp; as well.</p>