-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow custom favicon #362
Comments
Can you explain the purpose of supporting favicons? Since this is a development-only tool, it doesn't seem like that would be useful. |
Okay, I can see the value in it being obvious whether you are on production 😬. It seems an edge case, but it also seems like an easy thing to add. Perhaps the default icon should be some kind of Better Errors icon. |
I just wanted to see my usual favicon for the app so I can find the browser tab, so I did the following to to override the main.erb template in an initializer: module BetterErrors
# @private
class ErrorPage
class <<self
alias_method :original_template_path, :template_path
end
def self.template_path(template_name)
if template_name == "main"
File.expand_path("../../../lib/better_errors/templates/#{template_name}.erb", __FILE__)
else
original_template_path(template_name)
end
end
end
end The template I just overrode in place of the favicon (and saved in <!DOCTYPE html>
<html>
<head>
<title><%= exception_type %> at <%= request_path %></title>
<link rel="icon" type="image/png" href="/favicon.png">
</head>
... |
we have some pages that use a different favicon (or non .ico icons)
I think custom path might be the way to go, since that favicon caches are super long
Many thanks for such great errors
The text was updated successfully, but these errors were encountered: