我正在尝试在我的Rails-API应用程序中使用Doorkeeper集成oAuth2.0。但是我一直得到这个错误:"undefined method `helper_method' for ApplicationController",并且仍然找不到明确的解决方法。下面是我的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