【发布时间】:2014-07-26 11:20:13
【问题描述】:
阅读 Rails api 文档并观看此 railscast episode 后,我尝试在我的一个控制器中使用辅助方法:
class PostsController < ApplicationController
helper :readers, :otherhelper, :otherhelper2
def endpointMethod
readers_helper_method()
end
然后在app/helpers/readers_helper.rb:
module ReadersHelper
def readers_helper_method
...
end
end
但这给了我在 PostsController 中调用 readers_helper_method 的 NoMethodError。
我做错了什么?
【问题讨论】: