“Método indefinido” ao chamar o método auxiliar do controlador no Rails
Alguém sabe por que eu recebo
undefined method `my_method' for #<MyController:0x1043a7410>
quando eu chamo my_method ("string") de dentro da minha subclasse ApplicationController? Meu controlador parece
class MyController < ApplicationController
def show
@value = my_method(params[:string])
end
end
e meu ajudante
module ApplicationHelper
def my_method(string)
return string
end
end
e, finalmente, 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