Posted over 6 years ago. Visible to the public.

Rails, ActiveAdmin and CanCan

Building an admin interface for your rails application using activeadmin goes quick and easy. Some more work is required if you want to integrate with CanCan.

The available docs are quite good but I always forget howto setup the active admin controllers properly. Therefore here is the code that should be added to your active admin resources:

Copy
controller do load_and_authorize_resource :except => :index def scoped_collection end_of_association_chain.accessible_by(current_ability) end end

Owner of this card:

Avatar
jan0sch
Last edit:
over 6 years ago
Keywords:
authorization
Posted by jan0sch to jan0sch's deck
This website uses cookies to improve usability and analyze traffic.
Accept or learn more