我的Api :: Controller中ActionController::RoutingError (undefined method
门卫_为'when I added
doorkeeper_for:all`时出错。这是我的样本控制器。我做错了什么?
class Api::UsersController < ApplicationController
doorkeeper_for :all
def index
@users = User.all
end
end
答案 0 :(得分:10)
doorkeeper_for
方法已从门卫gem中删除。相反,做:
before_action :doorkeeper_authorize!
要解决任何其他问题,请始终参阅文档:https://github.com/doorkeeper-gem/doorkeeper