2014-06-27 19 views
0

我有一個奇怪的情況,我使用number_to_currency幫手ActionView::Helpers::NumberHelper。代碼使用此代碼片段:使用number_to_currency轉義格式

.price 
    .value= number_to_currency price, format: "%u<b>%n</b>", precision: 0 

當我在本地運行這個項目,它的工作原理,它應該是:

$ 500強(只有數字膽大)

但是,當我「M部署,爲階段服務器,它給了我:

$<b>500</b> 

我不知道什麼樣的問題是這樣的,我試圖預編譯資產,但沒沒有幫助。也試過html_safe沒有成功。

不知道如何解決這個問題?由於

回答

2

試試這個,可能是它會運行

.price .value= number_to_currency 100, format: "%u<b>%n</b>".html_safe, precision: 0