Roxy
Roxy

Reputation: 51

How do I add a <br> into my ERB tag?

I got a button that looks like this: button as it looks in the browser

Code for the button is :

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

How can I add a br tag so that the button text is displayed on 2 rows starting from "about"

REQUEST MORE INFO ABOUT

HOLIDAY EXTENSIONS HERE

Thanks in advance!

Upvotes: 1

Views: 567

Answers (2)

Mayur Shah
Mayur Shah

Reputation: 3449

In Ruby on Rails you can do like this:

<%=  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' %>

Upvotes: 3

bkunzi01
bkunzi01

Reputation: 4561

mail_to can take a block so do:

<%=  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 %>

You don't need the span tags but if you want to style them with color/embolden you can.

Upvotes: 4

Related Questions