# Need help: Nothing is inserted into the DOM

**URL:** <https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552>\
**Category:** Ruby\
**Created:** [February 24, 2017, 12:58pm UTC](https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552 "2017-02-24T12:58:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fiedl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fiedl/32/901_2.png) [@fiedl](https://community.miniprofiler.com/u/fiedl)\
**Post date:** [February 24, 2017, 12:58pm UTC](https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552/1 "2017-02-24T12:58:10Z")

</div>

Hi,

thanks for this awesome project! I’ve successfully used it before but ran into issues with a specific rails app recently:

1. My rails version is 4.2.7.1.
2. The rack-mini-profiler version is 0.10.2.
3. The rails environment is `development`.
4. Neither the `div.profiler-results` nor the `script#profilerTemplate` are inserted into the DOM. (It works with a fresh rails app.)
5. No javascript errors. In fact, removing all javascripts does not help.
6. The `tmp/miniprofiler` directory does not show up at first, but appears a couple of minutes later, which puzzles me.
7. `Rack::MiniProfiler` is the first entry of `rake middleware`.
8. [http://localhost:3000?pp=help](http://localhost:3000?pp=help) does work.

Could anyone give me a hint how rack-mini-profiler inserts the `div` and the `script` tag? Maybe from there, I can debug why those are missing.

Thanks!

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [February 24, 2017, 2:34pm UTC](https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552/2 "2017-02-24T14:34:04Z")

</div>

It happens here:

> <https://github.com/MiniProfiler/rack-mini-profiler/blob/master/lib/mini_profiler/profiler.rb#L342-L345>

what you could do is source it from local in your gemfile eg:

`gem 'rack-mini-profiler', path: '../rack-mini-profiler'`

and then add puts statements to see where it is stopping in the sequence.

But first things first, do you see it in `rake middleware` ?

---

<div class="post-metadata">

**Author:** ![fiedl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fiedl/32/901_2.png) [@fiedl](https://community.miniprofiler.com/u/fiedl)\
**Post date:** [February 24, 2017, 4:27pm UTC](https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552/3 "2017-02-24T16:27:36Z")

</div>

Thanks for your quick reply, @sam!

> [@sam](#):
>
> do you see it in `rake middleware` ?

Yes, I do:

```auto
➜ bundle exec rake middleware
I, [2017-02-24T13:52:50.031553 #42778] INFO -- : Celluloid 0.17.3 is running in BACKPORTED mode. [http://git.io/vJf3J]
[Simple Form] Simple Form is not configured in the application and will use the default values. Use `rails generate simple_form:install` to generate the Simple Form configuration.
use Rack::MiniProfiler
use Rack::Sendfile
use ActionDispatch::Static
use Rack::Lock
use Rack::Timeout
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use MetaRequest::Middlewares::Headers
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Warden::Manager
use MetaRequest::Middlewares::MetaRequestHandler
use MetaRequest::Middlewares::AppRequestHandler
use OmniAuth::Builder
use ExceptionNotification::Rack
use RedisAnalytics::Tracker
use Rack::Turnout
run MyApplication::Application.routes

```

Anything looking unusual here?

---

<div class="post-metadata">

**Author:** ![fiedl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fiedl/32/901_2.png) [@fiedl](https://community.miniprofiler.com/u/fiedl)\
**Post date:** [February 24, 2017, 4:42pm UTC](https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552/4 "2017-02-24T16:42:12Z")

</div>

I’ve added a debug output in

```
    # inject headers, script
    if status >= 200 && status < 300
      result = inject_profiler(env,status,headers,body)
      p "=== MINI PROFILER === 344 status #{status}"
      p result
      p "======="
      return client_settings.handle_cookie(result) if result
    end

```

I do see some outputs, but `result` appears to be `nil`:

```auto
"=== MINI PROFILER === 344 status 200"
nil
"======="

```

And, while grepping for this output, I’ve found something else:

**`MiniProfiler storage failure: private method url_for called for #<PagesController:0x007fb6cef9f2e0>`** ,

which is called here:

> <https://github.com/MiniProfiler/rack-mini-profiler/blob/master/lib/mini_profiler/profiler.rb#L594>

---

<div class="post-metadata">

**Author:** ![fiedl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fiedl/32/901_2.png) [@fiedl](https://community.miniprofiler.com/u/fiedl)\
**Post date:** [February 24, 2017, 5:14pm UTC](https://community.miniprofiler.com/t/need-help-nothing-is-inserted-into-the-dom/552/5 "2017-02-24T17:14:54Z")

</div>

> [@fiedl](#):
>
> MiniProfiler storage failure: private method url\_for called for #\<PagesController:0x007fb6cef9f2e0\>,

Ok, I’ve found it:

Indeed, I’ve overridden `url_for` in my `ApplicationController` as I need slightly different behaviour for permalinks in this application.

I thought that, in controllers, action methods should be `public`, other methods `private`. But defining the `url_for` override as `public` solves my issue.

Thanks for your help!
