How do I set up production profiling in rails?


#1

How do I configure MiniProfiler so it profiles pages in production for users that are administrators and has no impact for non admins?

Which files do I edit?


#2

You should be able to add a file, mini_profiler.rb to your config/initializers directory, with something like this:

Rack::MiniProfiler.configuration[:authorize_cb] = lambda do |env|
 # Your logic here to enable MP or not
end

Does that not work for you?


#3

I find that if I simply place it in the config section the settings do not take due to ordering