Rails or more specifically ActionView has a method simple_format which translates escape characters into html tags and can turn arbitrary user input tags into html. Ruby doesn't have a standard lib equivalent, and sometimes you only want to allow certain tags. In those cases, creating a simple line break helper may be useful. It may look like:
Throw an include where you need the method and you're good to go.
Place this in /helpers and you're set.
I used .to_s to ensure that gsub can be used and the method will not be broken by an array of strings.
The method .html_safe is a method on String
that creates a new ActiveSupport::SafeBuffer and flags it as @dirty. This tell Rails that its ok to render any unescaped html in the string.