Skip to content

Commit 47e4c2b

Browse files
committedJul 19, 2011
Merge pull request smartinez87#18 from professor/master
Clarified how to customize or add a new view
2 parents 24feff3 + 31c9c5e commit 47e4c2b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
 

‎README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,21 @@ access to the following variables:
4949
You can reorder the sections, or exclude sections completely, by altering the
5050
ExceptionNotifier.sections variable. You can even add new sections that
5151
describe application-specific data--just add the section's name to the list
52-
(whereever you'd like), and define the corresponding partial. Then, if your
53-
new section requires information that isn't available by default, make sure
52+
(wherever you'd like), and define the corresponding partial.
53+
54+
#Example with two new added sections
55+
Whatever::Application.config.middleware.use ExceptionNotifier,
56+
:email_prefix => "[Whatever] ",
57+
:sender_address => %{"notifier" <notifier@example.com>},
58+
:exception_recipients => %w{exceptions@example.com},
59+
:sections => %w{my_section1 my_section2} + ExceptionNotifier::Notifier.default_sections
60+
61+
When you add a new section or customize a section, you need to inform the gem where the views are.
62+
Create an initializer called config/initializers/exception_notifier.rb with the following code:
63+
64+
ExceptionNotifier::Notifier.prepend_view_path File.join(Rails.root, 'app/views')
65+
66+
If your new section requires information that isn't available by default, make sure
5467
it is made available to the email using the exception_data macro:
5568

5669
class ApplicationController < ActionController::Base

0 commit comments

Comments
 (0)
Please sign in to comment.