activeadmin


Active admin and Pundit


I have some difficulties to install Active Admin gem in Rails with Pundit.
In my Gemfile
gem 'activeadmin', github: 'activeadmin'
In my active_admin.rb
def authenticate_admin!
redirect_to new_user_session_path unless current_user && current_user.admin
end
ActiveAdmin.setup do |config|
# [...]
config.authentication_method = :authenticate_admin!
# [...]
config.current_user_method = :current_user
# [...]
config.logout_link_path = :destroy_user_session_path
# [...]
config.logout_link_method = :delete
end
I have this error when I go to /admin :
Pundit::PolicyScopingNotPerformedError at /admin
I think i have to define a policy but I don't know where. Do you have a good tutorial for this ?
I think you use something like this to verify the policy usage.
class ApplicationController < ActionController::Base
include Pundit
after_action :verify_authorized, except: :index
after_action :verify_policy_scoped, only: :index
end
ActiveAdmin don't support this checks. You can't configure them in the ApplicationController or you need to skip them for all ActiveAdmin Controllers

Related Links

Customize ActiveAdmin Page based on Roles
NoMethodError error for search_methods activeadmin
rails concerns - superclass mismatch error with active_admin in gems list
How to filter by “is not” in active admin/ransack
Active Admin image upload with refile
AuthorizationAdapter in ActiveAdmin
ActiveAdmin and Rails Engine. How do you keep the path name the same?
Active admin defining scope for custom page
ActiveAdmin: Can I redirect the user to the index after they create/edit something?
Active admin and Pundit
Sortable for has_many does not sort properly
select2 remove tag_list item
Adding Numeric Range Filtering to ActiveAdmin
undefined method `destroy_user_session_path' for active admin with cancancan and sorcery
Active admin not working in production mode
ActiveAdmin cannot authorize in rails-api project

Categories

HOME
memory
focus
android-fragments
key
google-play-services
qooxdoo
angular2-template
responsive-design
specifications
sharepoint-online
yeoman-generator-angular
twitter-oauth
match
buffer
ex
nest-api
cloudsim
coroutine
parceler
liferay-6.2
sipp
router
web-config-transform
tracing
android-cardview
jackrabbit-oak
macromedia
npoi
docx4j
instructions
windows2012
mongodb-3.4
delayed-job
fotorama
adminer
rails-postgresql
buildforge
busboy
des
jade4j
djcelery
oauth2-playground
minikube
roracle
uiautomatorviewer
visual-format-language
android-sharing
lvalue
swiperefreshlayout
multi-touch
okio
jsf-2.3
openseadragon
jtag
declarative
codecharge
node-glob
frame-grab
verisign
psd
jnlp
blockquote
uitest
textscan
ampersand
com0com
flow-js
fuseesb
nsmutabledata
findersync
google-hangouts
dos2unix
microsoft-expression-web
hp-idol-ondemand
rubber
visual-c++-2012
webautomation
accessory
thruway
nodeload
tnt4j
.net-remoting
office-app
cgrectmake
instance-variables
live-wallpaper
clearinterval
jzmq
fitch-proofs
n-queens
affinetransform
background-repeat
zend-server-ce
expression-web
vows
dip
iphone-sdk-4.3
bucket
gtktextview
database-cloning
index.dat

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App