【发布时间】:2018-05-04 10:04:09
【问题描述】:
我是 Pundit gem 的新手,但我遇到了一些问题。
我尝试显示包含多条记录的列表,但总是收到错误 AuthorizationNotPreformedError。
我做错了什么?
控制器:
def planning
@plans = Order.all
authorize @plans
end
政策:
def planning?
user.present?
end
Planning.html.haml
%h1 test
当我添加这个时:after_action :verify_policy_scoped, :only => planning, if: verify_policy_scoped?
我收到 PolicyScopingNotPerformedError。
【问题讨论】:
标签: ruby-on-rails ruby authorization pundit