如何将RDFa Lite 1.1 property="url"
添加到我的Rails link_to
?
<%= link_to "Lipsum", my_path, property: "url" %>
,自然会起作用。
期望的结果:
<a href="/my/path" property="url">Lipsum</a>
答案 0 :(得分:2)
来源:http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html
<%= link_to "Lipsum", my_path, { property: "url" } %>
在控制台中:
irb(main):011:0> ActionController::Base.helpers.link_to('test', advisors_path, { property: 'url' })
=> "<a property=\"url\" href=\"/advisors\">test</a>"