title: Rails - include module into controller, to be used in the view
body: <p>I'm really new to Rails and I try to setup a module file to be used in the view. So I believe the correct behavior is to define the module as a helper within a controller and voila, it should be working. However, that's not the case for me. Here is the structure.</p>
  
  <pre><code>lib
    functions
      -- form_manager.rb
  </code></pre>
  
  <p>form_manager.rb:</p>
  
  <pre><code>Module Functions 
    Module FormManager
      def error_message() ...
      end
    end
  end 
  </code></pre>
  
  <p>users_controller.rb</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
     helper FormManager
  
     def new ...
  </code></pre>
  
  <p>Well, the structure is like the above and when I call the error_message from <code>new.html.erb</code> it gives me the error: <code>uninitialized constant UsersController::FormManager</code>.</p>
  
  <p>So, first of all, I know that in rails 3 lib is not automatically loaded. Assuming that it is not mandatory to autoload the lib folder, how can I make this work and what am I missing?</p>
  
  <p>BTW, please don't say that this question is duplicate. I'm telling you I've been searching for this crap for almost 2 days. </p>