I have an array..
[1,2,3,4]
and I want a string containing all the elements separated by a newline..
1
2
3
4
You may not want to use html_safe, like ajay said, depending on context. Html safe can be a security issue. This depends on if the original input was actually html safe. HTML safe should not be called on input direct from a user and typically should be called before the view.
https://bibwild.wordpress.com/2013/12/19/you-never-want-to-call-html_safe-in-a-rails-template/
[edited in response to comment below]