title: Rails route: define root to namespace
body: <p>I've got 2 controllers:</p>
  
  <pre><code>app/
     /controllers
        posts_controllers.rb
        /mobile
           posts_controllers.rb
  </code></pre>
  
  <p>and my routes.rb looks like this:</p>
  
  <pre><code>root :to =&gt; "posts#index"
  resources :posts
  
  namespace :mobile do
     root :to =&gt; "posts#index"
     resources :posts
  end
  </code></pre>
  
  <p>but when i visit <code>/mobile</code>, it's anyway rendering index page of first controller, also tried this: </p>
  
  <pre><code>namespace :mobile do
     root :to =&gt; "mobile/posts#index"
     resources :posts
  end
  </code></pre>
  
  <p>but it's giving me error: <code>uninitialized constant Mobile::Mobile</code>
  I want to render the index page of second controller, how can i do that ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>By entering /mobile i want to render files located here:</p>
  
  <pre><code>app/
     views/
         /mobile
            /posts
               index.html.erb
  </code></pre>
  
  <p>But it's rending files here:</p>
  
  <pre><code>app/
     views/
         /posts
            index.html.erb
  </code></pre>