我写了一个小帮手方法在我的ApplicationController是这样的:访问自定义帮助
helper_method :dehumanize
def dehumanize (string)
string.parameterize.underscore
end
现在,我想在我的模型文件一个使用它,但它似乎没有可用那里。
我也试图与:
ApplicationController.dehumanize(title)
模型
,但它不工作。
如何使它在那里工作的任何线索?
感谢,
+1想出来的盒子 –