0
我正在使用Prawn PDF處理PDF發票。我正在嘗試使用number_to_currency
,同時通過unit
。在蝦PDF中添加貨幣單位? (語法錯誤)
def line_item_rows
[["Description", "Qty", "Unit Price", "Price GBP"]] +
@invoice.line_items.map do |item|
[item.name, item.quantity, price(item.unit_price), price(item.full_price)]
end
end
@view.number_to_currency(num, :unit => "£")
一個錯誤上述結果:
syntax error, unexpected $end, expecting ')'
@view.number_to_currency(num, :unit => "£")
^):
如果我使用HTML值,而不是簡單地輸出原始的HTML:
@view.number_to_currency(num, :unit => "£")
Total £2,266.00
是否有添加的一種特殊的方式£使用Prawn PDF時?上述嘗試在使用html/erb時正常工作,但在使用Prawn PDF時不能正常工作。
那就修好了,謝謝! – dannymcc 2013-04-03 23:46:29