From 1ccd21668e881ef1bb2364a3e67b1b1002a5b4bd Mon Sep 17 00:00:00 2001 From: Todd Sedano Date: Tue, 19 Jul 2011 11:54:01 -0700 Subject: [PATCH 1/2] Clarified how to customize or add a new view --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f30c7c6..e48dd7b0 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,21 @@ access to the following variables: You can reorder the sections, or exclude sections completely, by altering the ExceptionNotifier.sections variable. You can even add new sections that describe application-specific data--just add the section's name to the list -(whereever you'd like), and define the corresponding partial. Then, if your -new section requires information that isn't available by default, make sure +(wherever you'd like), and define the corresponding partial. + + #Example with two sections new sections added + Whatever::Application.config.middleware.use ExceptionNotifier, + :email_prefix => "[Whatever] ", + :sender_address => %{"notifier" }, + :exception_recipients => %w{exceptions@example.com}, + :sections => %w{my_section1 my_section2} + ExceptionNotifier::Notifier.default_sections + +When you add a new section or customize a section, you need to inform the gem where the views are. +Create an initializer called config/initializers/exception_notifier.rb with the following code: + + ExceptionNotifier::Notifier.prepend_view_path File.join(Rails.root, 'app/views') + +If your new section requires information that isn't available by default, make sure it is made available to the email using the exception_data macro: class ApplicationController < ActionController::Base From 31c9c5e2c9eb25583305c159dfb1fc5bb64b6708 Mon Sep 17 00:00:00 2001 From: Todd Sedano Date: Tue, 19 Jul 2011 11:55:11 -0700 Subject: [PATCH 2/2] Clarified how to customize or add a new view --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e48dd7b0..be8ee68d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ ExceptionNotifier.sections variable. You can even add new sections that describe application-specific data--just add the section's name to the list (wherever you'd like), and define the corresponding partial. - #Example with two sections new sections added + #Example with two new added sections Whatever::Application.config.middleware.use ExceptionNotifier, :email_prefix => "[Whatever] ", :sender_address => %{"notifier" },