title: How can I omit the module name when using autoloaded classes in Ruby on Rails?
body: <p>Let's say I've got the following files:</p>
  
  <pre><code>|- app
  |  |- helpers
  |  |  |- application_helper.rb
  |- config
  |- |- application.rb
  |- lib
  |  |- my_module
  |  |  |- my_class.rb
  </code></pre>
  
  <p>I'm trying to make Rails autoload <code>my_module</code>. In <code>application.rb</code> I set</p>
  
  <pre><code>config.autoload_paths += %W(#{config.root}/lib)
  </code></pre>
  
  <p>I've also managed to obtain the secret knowledge that in order for autoloading to work, the names of modules and classes must match the names of directories and files, so <code>my_class.rb</code> looks like this:</p>
  
  <pre><code>module MyModule
    class MyClass
      # ...
    end
  end
  </code></pre>
  
  <p>Now I want to use <code>MyClass</code> in my <code>application_helper.rb</code>:</p>
  
  <pre><code>module ApplicationHelper
  
    include MyModule
  
    def some_method(active_entry = nil)
      someobject = MyClass.new
      #...
    end
  
  end
  </code></pre>
  
  <p>But I'm getting an error</p>
  
  <pre><code>uninitialized constant ApplicationHelper::MyClass
  </code></pre>
  
  <p>In order to make this code work I must replace</p>
  
  <pre><code>someobject = MyClass.new
  </code></pre>
  
  <p>with</p>
  
  <pre><code>someobject = MyModule::MyClass.new
  </code></pre>
  
  <p>which is ugly. I thought that the <code>include</code> would work like a C++ <code>using namespace</code>, C# <code>using</code> or Java <code>import</code> but apparently it doesn't. So is there any equivalent to the above statements in Ruby?</p>