0
阅读Rails的API文档中,看这个railscast episode后,我试图用的辅助方法,在我的控制器之一,因为这样的:轨道4的ActionController :: Base的helper方法
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。 我在做什么错?
我不认为我会关注。 移动方法调用不应该改变它是否是类或实例方法? – Bladt