我正在尝试使用门卫将oAuth2.0集成到我的rails-api应用程序中.但是我一直得到这个错误,"针对ApplicationController的未定义方法`helper_method",但却找不到如何解决它的明确解决方案.bellow是我的application_controller.rb类,它有helper_method.我正在按照以下链接的教程,任何帮助将不胜感激.
https://www.sitepoint.com/getting-started-with-doorkeeper-and-oauth-2-0/
class ApplicationController < ActionController::API
private
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
helper_method :current_user
end
Run Code Online (Sandbox Code Playgroud) ruby-on-rails oauth-2.0 bcrypt-ruby doorkeeper ruby-on-rails-5