Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在ruby中对button_标记中的字符串进行编码?_Ruby On Rails_Encoding - Fatal编程技术网

Ruby on rails 如何在ruby中对button_标记中的字符串进行编码?

Ruby on rails 如何在ruby中对button_标记中的字符串进行编码?,ruby-on-rails,encoding,Ruby On Rails,Encoding,如何不转义amp编码的字符串 发件人: 我得到: <button>&amp;times;</button> 如何做到这一点 更新: 与[]相关,但没有明确的答案,并且有点过时使用html\u-safe禁用html实体的自动转义: = button_tag('&times;').html_safe 使用html\u safe禁用html实体的自动转义: = button_tag('&times;').html_safe 使用html\u saf

如何不转义amp编码的字符串

发件人:

我得到:

<button>&amp;times;</button>
如何做到这一点

更新:
与[]相关,但没有明确的答案,并且有点过时

使用
html\u-safe
禁用html实体的自动转义:

= button_tag('&times;').html_safe

使用
html\u safe
禁用html实体的自动转义:

= button_tag('&times;').html_safe

使用
html\u safe
禁用html实体的自动转义:

= button_tag('&times;').html_safe

使用
html\u safe
禁用html实体的自动转义:

= button_tag('&times;').html_safe