I've added the configuration pundit addapter authorization to my application
config.authorization_adapter = ActiveAdmin::PunditAdapter
When I login with the admin@example.com credentials I'm getting this error.
Pundit::NotDefinedError in Admin::Dashboard#index
unable to find policy AdminUserPolicy
Extracted source (around line #2):
insert_tag active_admin_application.view_factory["page"]
so I created these files in my policies/active_admin folder
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
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
What am I missing? Thanks for the help!