It's pretty simple, but I have not been able to find anything in the Rails documentation. There is a helper presentation method (Ruby code, not HAML code) that returns
link_to(user_controlled_text, destination, options)
and I need to wrap the HTML element (namely <bdi>) around user_controlled_text. If i do
link_to("<bdi>#{user_controlled_text}</bdi>", ...)
then my element is considered as part of the user-driven text to be escaped. Fair. How can I tell Rails not to avoid <bdi>and </bdi>, but still to avoid user_controlled_text?
source
share