Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying BaseController in rails ActiveAdmin gem

I am using the ActiveAdmin gem in a rails app. If I wanted to add a new before filter that applies to all activeadmin gems, how would I do this? I imagine I could modify the BaseController in ActiveAdmin to achieve this, but what is the proper way to make this modification from within the rails app? Is there a way to duplicate and overwrite the BaseController?

like image 277
John Avatar asked Nov 01 '12 15:11

John


1 Answers

If I understand you , there is a special config for this

  # == Controller Filters
  #
  # You can add before, after and around filters to all of your
  # Active Admin resources from here.
  #
   config.before_filter do



   end

you can find it in initializers/active_admin.rb

like image 121
Fivell Avatar answered Sep 18 '22 00:09

Fivell