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

Active admin install with Rails 4
ActiveAdmin won't save has many and belongs to many field
Truncate data in ActiveAdmin index page
Active Admin: how to set filter label dynamically
How to add an HTML-class to an ActiveAdmin index table
How to use modules to split very long code in active admin?
Downloading all records of a paginated resource in ActiveAdmin
Can you use the Form() command in ActiveAdmin in the content of a custom page?
CollectionAction route being skipped, action treated as ID
Possible to “split” an ActiveAdmin resource between multiple menu items?
Rails: activeadmin, undefined method `per' for #<ActiveRecord::Relation:0x4d15ee0>
Active Admin create form in register_page
ActiveAdmin - how to customize edit action?
ActiveAdmin - Filter with default value
Make semantic_errors render the exact error-message
ActiveAdmin - Custom action with reusing the show form

Categories

HOME
jboss
generics
keyboard
weblogic12c
dotnetnuke
haproxy
kivy
twitter-fabric
dronekit-python
u-boot
pyresttest
circleci
tiff
multi-step
freertos
outlook-restapi
squid
xbox360
vmware-workstation
jqxgrid
http-authentication
cpu-usage
significance
bazaar
adobe-illustrator
spring-shell
pe
quartz.net
dragula
strophe.js
unrar
gravity-forms-plugin
annotation-processing
code-climate
substance
copy-protection
argv
xerces-c
landscape
nsuserdefaults
djcelery
installanywhere
assert
sonarqube5.2
deployd
photoswipe
nonlinear-functions
ilrepack
entropy
sonatype
line-intersection
freshdesk
ptvs
.when
prefetch
pbx
petsc
portal
okio
svnserve
xcode8-beta4
oci
noclassdeffounderror
jemdoc
pack
ibm-was
nastran
highest
featuretoggle
360-degrees
uitest
clarion
fuseesb
fasterxml
string.format
aho-corasick
rpg
xsd2code
sql-view
codahale-metrics
flv
rikulo
examine
office-app
xalan
first-class
sigar
fork-join
servlet-container
eaccelerator
mygeneration
ninject-interception
principles
eai
inversion
server-load
activex-exe

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App