I create an admin panel in my application, I created a user forest controller for the administrator (the user model already exists) as follows:
rails g scaffold_controller Admin::User username:string password_digest:string role:string
and in routes
namespace :admin do resources :users resources :dashboard end
and the / admin / users _controllers.erb controllers look like
class Admin::UsersController < ApplicationController
so when I go to url / admin / users, I got the following error:
NameError in Admin::UsersController#index uninitialized constant Admin::User
How to solve this problem
thanks
source share