title: Rails routing and controller modules -namespacing?
body: <p>I have trouble creating a module for my controller, and getting my routes to point to that module within the controller.</p>
  
  <p>Getting this error:</p>
  
  <pre><code>Routing Error
  uninitialized constant Api::Fb
  </code></pre>
  
  <p>So, this is how my routes are set up:</p>
  
  <pre><code>namespace :api do
    namespace :fb do
      post :login
      resources :my_lists do
        resources :my_wishes
      end
    end
  end
  </code></pre>
  
  <p>In my fb_controller i want to include modules that will give me paths like this:</p>
  
  <pre><code>/api/fb/my_lists
  </code></pre>
  
  <p>This is some of my fb_controller:</p>
  
  <pre><code>class Api::FbController &lt; ApplicationController
    skip_before_filter :authenticate_user!, :only =&gt; [:login]
  
    include MyLists # &lt;-- This is where i want to include the /my_lists
                    # namespace(currently not working, and gives me error 
                    # mentioned above)
  
    def login
      #loads of logic
    end
  end
  </code></pre>
  
  <p>The MyLists.rb file(where i define a module) is in the same directory as the fb_controller.rb. </p>
  
  <p>How can i get the namespacing to point to my module inside of the fb_controller, like /api/fb/my_lists ?</p>