"Undefinierte Methode" beim Aufruf der Hilfsmethode vom Controller in Rails

Weiß jemand, warum ich bekomme

undefined method `my_method' for #<MyController:0x1043a7410>

wenn ich my_method ("string") in meiner ApplicationController-Unterklasse aufrufe? Mein Controller sieht aus wie

class MyController < ApplicationController
  def show
    @value = my_method(params[:string])
  end
end

und mein Helfer

module ApplicationHelper
  def my_method(string)
    return string
  end
end

und schließlich 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

Antworten auf die Frage(11)

Ihre Antwort auf die Frage