在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