diff --git a/README.md b/README.md index d34cdb41..beda0247 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,15 @@ BetterErrors.maximum_variable_inspect_size = 100_000 BetterErrors.ignored_classes = ['ActionDispatch::Request', 'ActionDispatch::Response'] ``` +## Setting the favicon + +By default BetterErrors will link to `/icon.png` and `/icon.svg` as the favicon. You can customize this by setting `BetterErrors.icon`: + +```ruby +# e.g. in config/initializers/better_errors.rb +BetterErrors.icon = '/assets/favicon' # will link to /assets/favicon.png and /assets/favicon.svg +``` + ## Get in touch! If you're using better_errors, I'd love to hear from you. Drop me a line and tell me what you think! diff --git a/lib/better_errors.rb b/lib/better_errors.rb index aff646e1..f0229fe7 100644 --- a/lib/better_errors.rb +++ b/lib/better_errors.rb @@ -47,10 +47,15 @@ class << self # List of classes that are excluded from inspection. # @return [Array] attr_accessor :ignored_classes + + # The abolsute path to the favicon without extension. + # @return [String] + attr_accessor :icon end @ignored_instance_variables = [] @maximum_variable_inspect_size = 100_000 @ignored_classes = ['ActionDispatch::Request', 'ActionDispatch::Response'] + @icon = "/icon" # Returns an object which responds to #url, which when called with # a filename and line number argument, diff --git a/lib/better_errors/templates/main.erb b/lib/better_errors/templates/main.erb index 37dc30de..bddde6c9 100644 --- a/lib/better_errors/templates/main.erb +++ b/lib/better_errors/templates/main.erb @@ -2,7 +2,12 @@