1

I'm getting the following error message when trying to access the admin/admin_users route provided by the Administrate gem: LoadError in Admin::AdminUsersController#index. The other admin routes (i.e. Users, Topics, Posts) work fine. I haven't changed any of the other default configuration for Administrate.

I encountered the bug while working on a code walkthrough available here: https://rails.devcamp.com/professional-rails-development-course/advanced-user-features/customizing-forms-administrate-dashboard. The URL contains a link to the repo; my local version is identical aside from using rails 5.

Portions of relevant files are included below. Any idea what might be causing this error?

localhost:3000/admin/admin_users

Unable to autoload constant Admin::AdminUsersController, expected .../app/controllers/admin/admin_users_controller.rb to define it

...

else
    require_or_load(expanded, qualified_name)
    raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it" unless from_mod.const_defined? (const_name, false)
    return from_mod.const_get(const_name)
  end
elsif mod = autoload_module!(from_mod, const_name, qualified_name, path_suffix)

../app/controllers/admin_user_controller.rb

module Admin
  class ApplicationController < Administrate::ApplicationController
  end
end

../config/routes.rb

Rails.application.routes.draw do
  namespace :admin do
    resources :users
    resources :topics
    resources :admin_users
    resources :posts

    root to: "users#index"
  end
...

../vendor/gemfile.rb

...
gem "administrate", "~> 0.3.0"
gem 'bourbon'
lgants
  • 3,665
  • 3
  • 22
  • 33

0 Answers0