なぜ私が得たのか誰か知っていますか
undefined method `my_method' for #<MyController:0x1043a7410>
ApplicationController サブクラス内から my_method("string") を呼び出すと? 私のコントローラーは次のようになります
class MyController < ApplicationController
def show
@value = my_method(params[:string])
end
end
そして私のヘルパー
module ApplicationHelper
def my_method(string)
return string
end
end
最後に、ApplicationController
class ApplicationController < ActionController::Base
after_filter :set_content_type
helper :all
helper_method :current_user_session, :current_user
filter_parameter_logging :password
protect_from_forgery # See ActionController::RequestForgeryProtection for details