title: How to remove mysterious whitespace from line breaks in Ruby on Rails?
body: <p>In my Rails application I have a field <code>address</code> which is a <code>varchar(255)</code> in my SQLite database.</p>
  
  <p>Yet whenever I save an address consisting of more than one line through a <code>textarea</code> form field, one mysterious whitespace character gets added to the right.</p>
  
  <p>This becomes visible only when the address is right aligned (like e.g. on a letterhead).</p>
  
  <p>Can anybody tell me why this is happening and how it can be prevented?</p>
  
  <p>I am not doing anything special with those addresses in my model.</p>
  
  <p>I already added this attribute writer to my model but it won't remove the whitespace unfortunately:</p>
  
  <pre><code>def address=(a)
    write_attribute(:address, a.strip)
  end
  </code></pre>
  
  <p>This is a screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/4nKXg.png" alt="screenshot"></p>
  
  <p>As you can see only the last line is right aligned. All others contain one character of whitespace at the end.</p>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>This would be the HTML output from my (Safari) console:</p>
  
  <pre><code>&lt;p&gt;
    "John Doe "&lt;br&gt;
    "123 Main Street "&lt;br&gt;
    "Eggham "&lt;br&gt;
    "United Kingdom"&lt;br&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I don't even know why it's putting the quotes around each line... Maybe that's part of the solution?</p>