title: Helpers in controller - Rails 3
body: <p>I migrated from rails 2.x to 3.x. Now when calling a controller method throws </p>
  
  <blockquote>
  <pre><code>undefined method `my_helper_method' for nil:NilClass
  </code></pre>
  </blockquote>
  
  <p>MyController.rb</p>
  
  <pre><code>class MyController &lt; ApplicationController
      def foo
        @template.my_helper_method
      end
  end
  </code></pre>
  
  <p>MyControllerHelper.rb</p>
  
  <pre><code>class MyControllerHelper
      def my_helper_method
        puts "Hello"
      end
  end
  </code></pre>
  
  <p>ApplicationController</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
     helper :all
  end
  </code></pre>
  
  <p>How to get this working?</p>