0

Can I enable/disable the javascript alerts(but could be even logs) only for some paths/controllers ?

I only found how to skip models, but nothing about paths or controllers. I got a lot of alerts on activeadmin and I cannot change that code.

For example I get one for the column :user_type line: (file app/admin/admin_users.rb)

index do
  column :email
  column :first_name
  column :last_name
  column :user_type

  default_actions
end
usha
  • 28,973
  • 5
  • 72
  • 93
Razvan Pavel
  • 321
  • 2
  • 9

1 Answers1

3

They updated the README to describe how to do this in 2015. For StackOverflow completeness, here's how to skip bullet in specific controller actions:

    class ApplicationController < ActionController::Base
        around_action :skip_bullet

        def skip_bullet
            Bullet.enable = false
            yield
        ensure
            Bullet.enable = true
        end
    end
Michael Keenan
  • 586
  • 7
  • 14