title: Rails 3 Engine Problem with Routes
body: <p>I have an engine, with this routes file:</p>
  
  <pre><code>Rails.application.routes.draw do
    resources :comments, :controller =&gt; 'opinio/comments'
  end
  </code></pre>
  
  <p>When I run the <code>rake routes</code> task, I get the correct output</p>
  
  <pre><code>     comments GET    /comments(.:format)           {:action=&gt;"index", :controller=&gt;"opinio/comments"}
                POST   /comments(.:format)           {:action=&gt;"create", :controller=&gt;"opinio/comments"}
    new_comment GET    /comments/new(.:format)       {:action=&gt;"new", :controller=&gt;"opinio/comments"}
   edit_comment GET    /comments/:id/edit(.:format)  {:action=&gt;"edit", :controller=&gt;"opinio/comments"}
        comment GET    /comments/:id(.:format)       {:action=&gt;"show", :controller=&gt;"opinio/comments"}
                PUT    /comments/:id(.:format)       {:action=&gt;"update", :controller=&gt;"opinio/comments"}
                DELETE /comments/:id(.:format)       {:action=&gt;"destroy", :controller=&gt;"opinio/comments"}
  </code></pre>
  
  <p>My controller is pretty simple:</p>
  
  <pre><code>class Opinio::CommentsController &lt; ApplicationController
    include Opinio::Controllers::InternalHelpers
  
    def index
      resource.comments.page(params[:page])
    end
  
    def create
      @comment = resource.comments.build(params[:comment])
      @comment.user = current_user
      if @comment.save
        flash[:notice] = I18n.translate('opinio.comment.sent', :default =&gt; "Comment sent successfully.")
      else
        flash[:error]  = I18n.translate('opinio.comment.error', :default =&gt; "Error sending the comment.")
      end
    end
  end
  </code></pre>
  
  <p>But when I try using any action that goes to the engine's controller I get the following error:</p>
  
  <pre><code>uninitialized constant Comment::CommentsController
  </code></pre>
  
  <p>I sincerely don't know where Rails is magically adding this <code>Comment</code> namespace on the controller, and I don't have a clue of how to solve this.</p>