views:

209

answers:

0

Hello Stack,

I'm migrating the majority of my application to the admin namespace and while there are lots of guides related to this, I still can't manage. I've been primarily following this answer, along with any results Google brings up (they all tend to agree). Could somebody please tell me what I'm doing wrong so I don't lose any more sleep?

Here is the error message:

wrong argument type Module (expected Class)

app/controllers/application_controller.rb:1:in `<top (required)>'
app/controllers/admin/admin_controller.rb:1:in `<top (required)>'
app/controllers/admin/home_controller.rb:1:in `<top (required)>'

routes.rb

namespace :admin do 
  root :to => "home#index"

  resources :users
end

admin/admin_controller.rb

class Admin::AdminController < ApplicationController

admin/home_controller.rb

class Admin::HomeController < Admin::AdminController

admin/users_controller.rb

class Admin::UsersController < Admin::AdminController

I'm mostly sure it's something simple to related to the module and controller interaction, so I haven't included any other code. However, I should have found the solution by now and please let me know if any additional code is required.

Thanks.