Reputation: 683
The <%= @post.source_account %>
is an email address. I want this to display as a link that says "Email Me" and when click it will open the users mail client
<% if @post.source_account.present? %>
<h4>Email Seller: <small> <%= @post.source_account %><br></h4>
<% end %>
Upvotes: 9
Views: 6425
Reputation: 7405
You can use mail_to
, which creates a mailto link tag to the specified email address:
<%= mail_to @post.source_account, "Email Me" %>
Upvotes: 17