也许我的问题可能无法完全理解,但我在Ruby On Rails网站上有一条路线,其中只包含我需要使用Curl检索的内容。问题是双引号是编码的,我不希望它们是这样的。
这里有一个例子(抱歉,但代码是保密的(:
# I tried to trim the data, and replace them with a backslash, so the double quote would render as normal, but no success
@data = @data.tr('"', '"')
但结果是:
我的名字是"Robert"
;
也许有人已经遇到了这个问题,但我什么都没找到。谢谢大家!
解决方案是在我的html.erb中添加:<%= @data.html_safe %>
,感谢@javijyu的回答!