在rails 3中,是否可以在庫類中使用helper函數?例如,我有幫手:Lib類中的用戶幫助函數
module CarHelper
def total_price(cars)
#Do something here
end
end
在我的庫/ my_library.rb
class MyLibrary
def myFunc
# I would like to use helper function total_price(cars) here
end
末
如何在庫類使用助手的功能呢?
CarHelper :: total_price(cars)?或CarHelper.total_price(汽車),我不記得確切 – apneadiving 2011-03-03 09:21:42
你解決了如何做到這一點@梅隆 – 2015-03-13 18:15:34