link_to "hi",content_tag(:p,"hello")
produces me
"<a href=\"<p>hello</p>\">hi</a>"
i don't want the escaped output. how to get a html_safe string?
link_to "hi",content_tag(:p,"hello")
produces me
"<a href=\"<p>hello</p>\">hi</a>"
i don't want the escaped output. how to get a html_safe string?
You reversed arguments order - see http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to
Correct syntax is link_to content, url
so what you probably wanted to do is:
link_to content_tag(:p, "hello"), "some_url"
This will not be escaped. If what you need is indeed content_tag as url then you can add "html_safe" method at the end:
link_to "hi",content_tag(:p,"hello").html_safe