undefined方法`doorkeeper_for'错误

时间:2015-10-10 13:37:41

标签: ruby-on-rails ruby-on-rails-4 doorkeeper

我的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

1 个答案:

答案 0 :(得分:10)

doorkeeper_for方法已从门卫gem中删除。相反,做:

before_action :doorkeeper_authorize!

要解决任何其他问题,请始终参阅文档:https://github.com/doorkeeper-gem/doorkeeper