1

How do I add RDFa Lite 1.1 property="url" to my Rails link_to?

<%= link_to "Lipsum", my_path, property: "url" %>, naturally, won't work.

Desired outcome:

<a href="/my/path" property="url">Lipsum</a>

1 Answer 1

2

Source: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html

<%= link_to "Lipsum", my_path, { property: "url" } %>

In console:

irb(main):011:0> ActionController::Base.helpers.link_to('test', advisors_path, { property: 'url' })
=> "<a property=\"url\" href=\"/advisors\">test</a>"
Sign up to request clarification or add additional context in comments.

2 Comments

By the way man, any chance you're up for hire for a short gig?
@MarkBoulder Always interested in opportunities. Feel free to email me tomfast at gmail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.