2017-07-26 79 views
1

我有一個按鈕,看起來像這樣: button as it looks in the browser如何將<br>添加到我的ERB標籤中?

代碼的按鈕:

<%= mail_to "[email protected]", 'Request more info about holiday extensions here', Subject: "Hi Please include your name and email address", class: 'button-email' %>

我如何添加br標籤,以便顯示按鈕文本從「」開始的2行上「

索取更多信息關於

HOLIDAY EXTENSIONS這裏

提前感謝!

回答

3

Ruby on Rails的,你可以這樣做:您的反饋

<%= mail_to "[email protected]", "Request more info about <br />holiday extensions here".html_safe, Subject: "Hi Please include your name and email address", class: 'button-email' %> 
+0

這對我非常感謝! – Roxy

+0

抱歉,我不知道.... noob在這裏:) – Roxy

4

MAIL_TO可以採取塊這樣做:

<%= mail_to "[email protected]", subject: "Hi Please include your name", class: 'button-email' do 
    <span>Request more info about</span> <br> <span>holiday extensions here</span> 
end %> 

你並不需要跨度標籤,但如果你想用顏色來他們的風格/壯膽即可。

+1

非常感謝! – Roxy