uninitialized constant devise::controllers::internalhelpers

做~自己de王妃 提交于 2019-12-23 08:52:17

问题


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!



来源:https://stackoverflow.com/questions/11634605/uninitialized-constant-devisecontrollersinternalhelpers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!