0

I have an item in a set of show profiles pages that gives an email from a seeded database:

  <h4><%= @admin.email %></h4>

Which needs to be converted into a mail_to tag, similar to this : <p><%= mail_to 'info@db.com', "info@db.com" %> What I came up with looks like this:

<% @admin.each do |agent| %>
  <h4<%= mail_to <%= agent.email %>, "<%= agent.email %>" %></h4>
<%end%>

But it's crashing, with the error syntax error, unexpected keyword_end, expecting ')' '.freeze; end ^

Any ideas?

Boucherie
  • 541
  • 4
  • 20

1 Answers1

1

Remove unnecessary <%%> symbols:

<% @admin.each do |agent| %>
  <h4><%= mail_to agent.email, agent.email %></h4>
<% end %>
Inpego
  • 2,657
  • 13
  • 14