Bruno E.
Bruno E.

Reputation: 1424

How to use rack-mini-profiler for ajax calls?

I managed to get rack-mini-profiler gem to run fine on the full pages we serve in our app. What I didn't manage is, how to directly get the data also for one of the calls we serve via ajax to another page. I found, that if I do the ajax call and then call one of our full page requests, I see also the ajax timing, but this is kind of cumbersome to do.

Do you have any tips on how to see the small menu also directly on the page where the ajax call is done? Our ajax call is returning html and there would be enough space to show the menu.

Upvotes: 4

Views: 1459

Answers (2)

builder-7000
builder-7000

Reputation: 7627

Once you've added rack-miniprofiler to your bundle, then you need to set disable_caching = true. You can do this in an initializer:

# config/initializers/rack_profiler.rb
if Rails.env.development?
  Rack::MiniProfiler.config.disable_caching = true
end

Upvotes: 0

craig.kaminsky
craig.kaminsky

Reputation: 5598

My apologies for responding with an indirect answer to your question. But, I highly recommend the Chrome Extension (and associated gems) Rails Panel, particularly for investigating Ajax/Async calls with Rails.

I use it daily at work and find it to be a great tool.

Upvotes: 3

Related Questions