ruby on rails - CanCan authorize all controllers -


i have cancan , rolify set activeadmin, , it's time force authorization on controllers.

do have authorize_resource on every controller (we have couple dozen models , controllers now), or there way apply of activeadmin controllers?

i tried calling in before_filter activeadmin.setup, didn't work.

i made initializer: config/initializers/active_admin-cancan.rb

module activeadmin   class resourcecontroller         # if don't skip loading on #index exception:     #     #     "collection not paginated scope. set collection.page(params[:page]).per(10) before calling :paginated_collection."      load_resource :except => :index     authorize_resource      def scoped_collection       end_of_association_chain.accessible_by(current_ability)     end   end end 

borrowed user's code, can't find source more.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -