0
我正在尝试构建一个字符串,该字符串将作为电子邮件的正文传递给UserMailer。无法在电子邮件上正确显示链接
下面是代码:
html_text = ""
topic_object.title = "Example title"
topic_object.body = "Example body"
html_text << 'Visit the page by <a href="http://localhost.com/topic_digests/#{topic_object.slug}>" clicking here</a>.<br>'
html_text << topic_object.title
html_text << topic_object.body
那么我这一行提供的电子邮件
UserMailer.dynamic_actual_digest(current_user.email, html_text).deliver
我的挑战是,我不能让clicking here
文本与正确的URL我的超链接需要。它不呈现它。我试过link_to,我试过双引号,我试过<%= topic_object.slug %>
。
我相信问题在于,即使使用link_to
方法或a
html标记,也需要同一行上的双引号和单引号。
我缺少什么?