is what you are looking for
@place.description.html_safe.gsub("\n", '<br/>')
? But on the other hand, does using html_safe for this site mean an XSS attack? (because it assumes the description is safe).
So the best solution would not be
<%= (h @place.description).gsub("\n", '<br/>') %>
at first I thought
<%= (h @place.description).gsub("\n", '<br/>'.html_safe) %>
but in fact both versions work. Then I tested by adding some HTML tags to the description and it got escaped < etc., therefore, it prevents an XSS attack.
source share