Skip to content

Doesnt Seem to be working with Mountable Rails engines #178

Description

@shshankjain

I am able to get it working in the development environment with basic pages (root level). But when I navigate inside a Rails (mountable) engine, I stop seeing miniprofiler data.

The moment I go back to application root, I can see multiple miniprofiler badges with data.

Changing the below in https://github.com/SamSaffron/MiniProfiler/blob/master/Ruby/lib/mini_profiler/profiler.rb#L509

    def get_profile_script(env)
      ids = ids_comma_separated(env)
      path = "#{env['SCRIPT_NAME']}#{@config.base_url_path}"

to

    def get_profile_script(env)
      ids = ids_comma_separated(env)
      # Could be done better for applications which are deployed under non root context
      path = "#{@config.base_url_path}"

Fixes the issue.

Note : Using rails (3.2.12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions