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標記,也需要同一行上的雙引號和單引號。
我缺少什麼?