Skip to content

Instantly share code, notes, and snippets.

@jonniesweb
Created January 7, 2019 16:17
Show Gist options
  • Save jonniesweb/c17c0587b9478c7d6f53c4e3aee5c5b7 to your computer and use it in GitHub Desktop.
Save jonniesweb/c17c0587b9478c7d6f53c4e3aee5c5b7 to your computer and use it in GitHub Desktop.
rack_mini_profiler only run if user is authorized and url param is present
before_action do
if current_user
&& current_user.is_admin?
&& params(:pp)
Rack::MiniProfiler.authorize_request
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment