Skip before filter with Active Admin

前端 未结 4 930
逝去的感伤
逝去的感伤 2021-01-11 14:19

I am using devise and recently added active admin, which created a separate table of admin_users to keep admins.

All works fine with Active Admin when I try to log i

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-11 14:52

    both of the corey and Sooie are right... but only partially, to stop your blanket authorize_user! filter from affecting active_admin you need to implement both of their answers...

    config/initializers/active_admin.rb

    config.skip_before_filter :authorize_user!
    

    app/admin/dashboard.rb

    controller do
      skip_before_filter :authorize_user!
    end
    

提交回复
热议问题