headwayio / voyage

A Rails template with our standard defaults, ready to deploy to Heroku. **See readme in: lib/voyage/README.md**
https://headway.io/voyage
MIT License
0 stars 1 forks source link

Add rollbar config #92

Closed jondkinney closed 6 years ago

jondkinney commented 6 years ago

Add to _javascript.html.erb template

<%= render 'application/rollbar_js' %>

Look how we're doing it for analytics and analytics_identify and inject it at the top of the file.

<script type='text/javascript'>
    var _rollbarConfig = {
            accessToken: "<%= ENV['ROLLBAR_ACCESS_TOKEN] %>",
            captureUncaught: true,
            captureUnhandledRejections: true,
            payload: {
        environment: "<%= Rails.env %>"
            }
    };
    !function(r){function o(e){if(n[e])return n[e].exports;var t=n[e]={...

Rise (athletefit_backend) has this done already, so look there for how we should do it.

GeekOnCoffee commented 6 years ago

For posterity, this can be done in the initializer with https://github.com/rollbar/rollbar-gem#integration-with-rollbarjs and has been done in the template.