How to print a string in erb file including line breaks

Viewed 3249

After getting an input from a user, I'm having a string like so:

str = "First line/nSecond line/nThird line"

When I'm trying to print it in my erb file like so:

<%= str %>

I'm getting only one line without any line's breaks ("First line Second line Third line")

My question is:

How to print a string in erb file including the line's breaks?

(I guess i can replace every \n with <br> tag but I wonder if there's a better way of achieving that?!)

2 Answers
Related