Sha256: ff064e67f6a0469d2f58e272577e440263f663f645fdbf0098ed1c7f4541fa86
Contents?: true
Size: 1.29 KB
Versions: 1
Compression:
Stored size: 1.29 KB
Contents
# Tastes Bitter Get an email notification when a JavaScript error occurs in your Rails application. ## How it works The JavaScript hooks into the `window.onerror` event by sending an XHR with the error data which is then emailed. ## Install Add the gem to your `Gemfile`. ```ruby gem 'tastes_bitter' ``` Use Bundler to install it. ```console $ bundle install ``` Run the install generator. ```console $ bundle exec rails generate tastes_bitter:install ``` ## Configure Open `config/initializers/tastes_bitter.rb` and update the configuration. ```ruby TastesBitter.configure do |config| config.mailer_receiver = "notifications@example.com" config.mailer_sender = "notifications@example.com" config.mailer_subject_prefix = "[JavaScript Error] " end ``` Make sure you have [ActionMailer configured](http://api.rubyonrails.org/classes/ActionMailer/Base.html) in order for emails to be sent. Add the JavaScript file to `application.js`. ```coffeescript //= require tastes_bitter/javascript_errors ``` It **does** matter where you include the JavaScript. It will only catch errors that occur *after* it has been loaded into the page. In general, you'll want to include it around the top of `application.js`. This will ensure it catches all errors from any other JavaScript code in your application.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tastes_bitter-0.0.2 | README.md |