devise overriding registrations controller - uninitialized constant Users::RegistrationsController

后端 未结 6 1966
时光说笑
时光说笑 2021-01-04 04:34

I\'m trying to override some the functionality of the default devise registrations controller so that only certain users can create accounts for others. So in a file called

6条回答
  •  半阙折子戏
    2021-01-04 05:10

    Where was your registrations_controller.rb saved to? The location is important. I found that I was making a mistake saving it to app/controllers/devise/.. It simply needed to be saved in app/controllers/. e.g.:

    app/controllers/registrations_controller.rb


    Also, config/routes.rb route should be defined as:

    devise_for :users, controllers: { registrations: 'registrations' }

提交回复
热议问题