在我生成的pdf中,我得到了这个
0,00 €
代替
0,00 €
Application.html.erb
<meta charset="utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
show.html.erb
<%=number_to_currency item.total%>
解决方法
respond_to do |format| format.html { render :template => "invoices/show"} format.pdf {render :pdf => "invoices/show",:template => 'invoices/show',formats: :html,encoding: 'utf8'} end