Module: Whoopsie::WhoopsieHelper

Defined in:
app/helpers/whoopsie/whoopsie_helper.rb

Instance Method Summary collapse

Instance Method Details

#whoopsie_config(extra = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/whoopsie/whoopsie_helper.rb', line 3

def whoopsie_config(extra = {})
  (<<-EOS).strip_heredoc.html_safe
    <script>
      window.Whoopsie = window.Whoopsie || {};
      window.Whoopsie.enabled                 = #{Rails.application.config.whoopsie.enable.to_json};
      window.Whoopsie.client_notification_url = "#{errors_path}";
      window.Whoopsie.extra = function(){
        var extra = #{extra.to_json};
        extra.location = window.location.toString();
        return extra;
      }
    </script>
  EOS
end