开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜