title: How to get new line separated text in ruby on rails
body: <p>Scenario: Backend(rails) is outputting Json, android app is consuming json.</p>
  
  <p>In the app, I need to open Gmail client(through deep linking) with json data from back end, such that the data is an email text and it has new lines in it. here is what i tried doing:</p>
  
  <blockquote>
    <p>I tried sending with new line characters in my view(using jbuilder):</p>
  </blockquote>
  
  <pre><code>json.email "Hey Friend, &lt;%= "\r\n"%&gt; Some text &lt;%= "\r\n"%&gt; Cheers! &lt;%= "\r\n"%&gt;  Have a great day! "
  </code></pre>
  
  <p><strong><em>json output</em></strong></p>
  
  <pre><code>"email": "Hey Friend, Some text Cheers! Have a great day!"
  </code></pre>
  
  <blockquote>
    <p>I tried sending html:</p>
  </blockquote>
  
  <pre><code>json.email: "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey Friend, &lt;br/&gt; &lt;br/&gt;Some text &lt;br/&gt; Cheers! &lt;br/&gt;  Have a great day! &lt;br/&gt; &lt;/body&gt;&lt;/html&gt;"
  </code></pre>
  
  <p><strong><em>json output</em></strong></p>
  
  <pre><code>"email": "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey Friend, &lt;br/&gt; &lt;br/&gt;Some text &lt;br/&gt; Cheers! &lt;br/&gt;  Have a great day! &lt;br/&gt; &lt;/body&gt;&lt;/html&gt;"
  </code></pre>
  
  <p>which when gets consumed at gmail client outputs exact html.</p>
  
  <p><strong><em>Desired Output:</em></strong></p>
  
  <p>Hey Friend,</p>
  
  <p>Some Text</p>
  
  <p>Cheers!</p>
  
  <p>Have a great day!</p>
  
  <p>Any help will be appreciated!</p>