Rails - Text's double spaces to single space
text_from_db = "I love Ruby"
When I display this in the view, it shows as "I love Ruby". There should be two spaces after the word 'love'. I've tried si开发者_开发知识库mple_format but it doesn't seem to work.
This is an HTML question, the clue is that you do see two spaces in the HTML source. All you need to do is make sure that the
white-space: pre;
CSS property is applied to your text, for example by using the <pre>
elemeent
精彩评论