activeadmin


Customize ActiveAdmin Page based on Roles


How can we customize an ActiveAdmin page for different users based on their role:
ActiveAdmin.register_page 'Dashboard' do
content title: 'Admin Content' do
# show this only to admins
end
content title: 'Reviewer Content' do
# show this only to reviewers
end
end
After trying several complicated things, the solution was straightforward:
ActiveAdmin.register_page 'Dashboard' do
menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }
content title: proc { I18n.t('active_admin.dashboard') } do
render partial: current_user.admin? ? 'admin_dashboard' : 'content_dashboard'
end
end
Then you can render those partials based on roles.

Related Links

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
How can I create an ActiveAdmin filter that will show only objects without a value specified?
jQuery, activeadmin: custom filter with ransack. how to alter displayed text in search box

Categories

HOME
office365
protocol-buffers
d3.js
concurrency
selenium-builder
devexpress
haproxy
out-of-memory
openflow
moodle-api
hyperledger
jint
visualforce
u-boot
scheduler
hspi
eddystone
yeoman-generator-angular
scrape
parsley.js
sql-injection
phonegap-build
vmware-workstation
tomcat8
android-contacts
pickle
string-formatting
multiple-tables
weex
kamailio
nurbs
jpa-2.1
router
xdebug
react-bootstrap-table
bobo-browse.net
envoy
fotorama
universal
knights-tour
advanced-filter
payeezy
directfb
char-pointer
assertions
love2d
macports
fastlane
ng-repeat
linq.js
hdiv
vungle-ads
httphandler
adblock
extjs4.1
deedle
alertify
spring-mongo
fragmentstatepageradapter
dojo-build
eclemma
node.js-connect
sharepoint-apps
trust
wikimedia-commons
odesk
deeplink
boost-proto
msgpack
stack-smash
libz
kotlin-android-extensions
createfile
nhibernate-criteria
uno
sunos
juttle
thoughtworks-go
tabris
visual-studio-6
lumia-imaging-sdk
accessory
jini
miglayout
hotswap
boolean-algebra
jchartfx
xsd2code
boinc
html-frames
jquery-cycle
contextswitchdeadlock
office-app
server-name
uipangesturerecognizer
flymake
3-tier
rational-unified-process
subtext
downcasting
xap
error-detection

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