Every time I try to combine a string with link_to, it displays in my browser as escaped HTML.
eg.
%(TEST #{link_to(object.title, object)}) OUTPUTS TEST <a href="/objects/3">TEST OBJECT</a>
Why is this happening? Every example that I see on the network is not referenced by link_to.
In Rails 3, output is escaped by default. If you add .html_safeto your line, it will do what you expect.
.html_safe
%(TEST #{link_to(object.title, object)}).html_safe
This also does the job:
<%=raw %(TEST #{link_to(object.title, object)}) %>