我在我的标签中使用html_safe方法,以便在该标签内放置一个链接,但它无法正常工作
:此
Acepto los <%= f.label ("#{link_to 'Terminos y condiciones', terms_path}").html_safe, class: "inline" %>
打印
Acepto los <a href="/terms">terminos y condiciones</a>
有什么想法吗?
谢谢!
答案 0 :(得分:1)
用块来试试;我认为在你的情况下label_tag
可能更好吗?
<%= label_tag class: "inline" do %>
<%= link_to 'Terminos y condiciones', terms_path %>
<% end %>