# How to detect if enabled or disabled?

**URL:** <https://community.miniprofiler.com/t/how-to-detect-if-enabled-or-disabled/292>\
**Category:** Ruby\
**Created:** [June 20, 2014, 10:59am UTC](https://community.miniprofiler.com/t/how-to-detect-if-enabled-or-disabled/292 "2014-06-20T10:59:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tintin81](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/tintin81/32/1050_2.png) [@Tintin81](https://community.miniprofiler.com/u/Tintin81)\
**Post date:** [June 20, 2014, 10:59am UTC](https://community.miniprofiler.com/t/how-to-detect-if-enabled-or-disabled/292/1 "2014-06-20T10:59:09Z")

</div>

Hello,

In my Rails 4 app I created these two helper functions:

```
def link_to_switch_off_miniprofiler
  link_to "OFF", "?pp=disable"
end

def link_to_switch_on_miniprofiler
  link_to "ON", "?pp=enable"
end

```

Is there any way to detect if MiniProfiler is currently **enabled** or **disabled** , so I can combine my two functions into one?

Thanks for any help.
