Как заставить Active Admin работать с Pundit после входа в систему
Я добавил конфигурацию pundit addapter для моего приложения
config.authorization_adapter = ActiveAdmin::PunditAdapter
Когда я вхожу с учетными данными [email protected], я получаю эту ошибку.
Pundit::NotDefinedError in Admin::Dashboard#index
unable to find policy AdminUserPolicy
Extracted source (around line #2):
insert_tag active_admin_application.view_factory["page"]
поэтому я создал эти файлы в моей папке policy / active_admin
adminuser_policy.rb
module ActiveAdmin
class AdminUserPolicy < ApplicationPolicy
class Scope < Struct.new(:user, :scope)
def resolve
scope
end
end
def home?
true
end
def index?
true
end
def show?
true
end
def new?
true
end
def create?
true
end
def update?
true
end
def destroy?
true
end
end
конец
page_policy.rb
module ActiveAdmin
class PagePolicy < ApplicationPolicy
class Scope < Struct.new(:user, :scope)
def resolve
scope
end
end
def index?
true
end
def show?
true
end
end
end
Что мне не хватает? Спасибо за помощь!