Show <br/> in <p>
i replaced line feed characters with HTML line break as
@post.description.gsub(/\n/, "<br/>")
I am trying to show the output w开发者_JAVA百科ithin
tags. But I see as follows:
Used, like new book<br/>New book costs $150<br/>Awesome book!
Need help. Thanks.
Use simple_format
for this as it will automatically convert new lines into breaks.
<%= simple_format(@post.description) %>
精彩评论