title: Routing errors when adding an Admin namespace
body: <p>I added an Admin namespace to my app so when logging in to the administration area, it would have to be like this: admin/websites and admin/page/8</p>
  
  <p>So this is what I have in my routes.rb</p>
  
  <pre><code>namespace :admin do |admin|
    match '/' =&gt; 'dashboard#index'
    resources :websites
    resources :pages
    resources :sessions
    get 'login' =&gt; 'sessions#new', :as =&gt; 'login'
    get 'logout' =&gt; 'sessions#destroy', :as =&gt; 'logout'  
  end
  </code></pre>
  
  <p>I have admin_controller.rb in app/controllers directory.</p>
  
  <pre><code>class Admin::BaseController &lt; ApplicationController
    protect_from_forgery
    include UrlHelper
    ...
  </code></pre>
  
  <p>I created an admin directory inside app/controllers. So I have this inside app/controllers/admin/websites_controller.rb</p>
  
  <pre><code>class Admin::WebsitesController &lt; ApplicationController
  </code></pre>
  
  <p>Some other answers suggested class Admin::WebsitesController &lt; Admin::BaseController, but that never worked for me. If I'm wrong please let me know.</p>
  
  <p>So then in my layout file (app/views/layouts/application.html.erb) I have links like this one <code>edit_admin_website_path(@website)</code> that give me routing errors <code>Routing Error No route matches {:action=&gt;"edit", :controller=&gt;"admin/websites"}</code> Whyyyy?! :(</p>