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