Sanitize HTML, replace end lines with BR view: = nl2br(sanitize(message, tags: [])).html_safe controller: nl2br(ActionView::Base.full_sanitizer.sanitize(message)).html_safe helper: # app/helpers/message_helper.rb def nl2br(s) s.gsub(/\n/, '<br>') end