且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ruby on Rails CSV put& quot;& quot;而不是实际的报价

更新时间:2023-02-14 20:38:26

而不是在数组的每个部分调用html_safe然后从中创建一个新的(非html安全的)字符串,在从 generate_line

Instead of calling html_safe on each part of the array and then making a new (non-html-safe) string from it, try calling it at the end, after the string is returned from generate_line:

<%= CSV.generate_line(row).html_safe %>