2015-11-05 51 views

回答

0

强制编码前先转换为字符串。试试以下代码:

<% product_prices = [] %> 
<% product.product_prices.collect{|product_price| product_prices << number_to_currency(product_price.price.to_f, :unit => "£").to_s.force_encoding(Encoding::UTF_8)} %> 
+0

已经使用,但没有帮助它。任何其他? – user1780370

+0

您是否尝试将'.each'更改为'.collect'?你是否用'<% %>'分隔了每行。我更新了上面的代码。 – 2015-11-05 13:04:50

+0

我试过但没有任何变化.. – user1780370

相关问题