uninitialized constant devise::controllers::intern

2019-06-17 02:51发布

问题:

I'm new to rails and currently working on authentication using devise gem. I would like to communicate with my server from my mobile app. So I'm sending data via JSON. When I tried to sign in it shows me the below error:

  ActionController::RoutingError (uninitialized constant Devise::Controllers::InternalHelpers):
  app/controllers/session_controller.rb:4:in `<class:SessionController>'
  app/controllers/session_controller.rb:1:in `<top (required)>'

When I was using devise gem version 1.4.6, it was working fine for me. But, I want to make it work with devise version 2.1.0 or later to be able to use any new features that it supports.

If anybody have this running or have any idea please help me. Thanks in advance.

Regards,

Senthil.

回答1:

Looking at the past commit, InternalHelpers has been removed: https://github.com/plataformatec/devise/commit/d9df632671b568e85bc79feb2c8de54fa0518f73

Based on the test case for InternalHelpers, you should now, inherit directly from DeviseController as most InternalHelper methods are included in there already.

https://github.com/plataformatec/devise/blob/master/test/controllers/internal_helpers_test.rb

class MyController < DeviseController

end

Hope this helps!