Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding line break to link_to in Rails

I have a code that needs to be split into two lines so it looks nice. However when I try:

link_to "Some Text<br />Here",url_path

it will output the HTML too, even if I use html.html_safe like so:

html = ""
html += link_to "Some Text<br />Here",url_path
html.html_safe

How can I make it so "Here" will appear on a new line?

like image 235
Travis Pessetto Avatar asked Aug 01 '11 20:08

Travis Pessetto


1 Answers

link_to "Some Text<br />Here".html_safe, url_path
like image 87
Jeremy Roman Avatar answered Sep 28 '22 11:09

Jeremy Roman