-
Notifications
You must be signed in to change notification settings - Fork 22.1k
Add favicon to internal routes /favicon.ico
#42702
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
Conversation
|
The root route to the welcomes_controller gets overridden in apps. |
|
An older but closed PR that tried adding the favicon to |
|
We could also just inline the icon in the welcome template. https://stackoverflow.com/a/62438464 This makes sure there are no extra routes, which might still be enabled by default. |
5a86de7 to
5d1146f
Compare
@p8 inlining the favicon works for me 🙂 |
|
@hahmed Curious where you got the svg from, does it show up in the screenshot in the description of this PR too? LGTM though, I generally like this approach but we may want to move the SVG content to a helper that can be tested, this way if Rails ever changes its logo a code search for "logo" will show up. 🤔 |
It’s actually a jpg. Which is not ideal since it has no transparency: An SVG would be great here. Using this SVG it would look more like this:
If we do that for the favicon it would mean doing this for all other images on the page (which also include the logo). Perhaps a comment, e.g. |
e67d102 to
1cdd4cf
Compare
I have moved this to a var in the view, added a descriptive name, hope that's ok? Could you clarify how it could be tested? Also I'm not sure we are testing the other 2 images on the page either... |
1cdd4cf to
f72953a
Compare
4737415 to
4def5dd
Compare
922842a to
98824f6
Compare
|
The logo is a bit outdated. I'll try to see if I can generate a SVG from https://www.pngegg.com/en/png-zrbae |
Co-authored-by: Sunny Ripert <sunny@sunfox.org> Co-authored-by: Petrik de Heus <petrik@deheus.net>
98824f6 to
49332c9
Compare
|
Awesome, thanks @p8 I have updated and added a screenshot of the new svg logo. Does that look ok now? |
|
Why I never though about it? Good job ma'men! |



Summary
When creating a new app and running the rails application (rails welcome page), there is an error with the
/favicon.icorequest. This PR adds an internal route for the rails template to serve the favicon by sending back anhead :okresponse.Previously the error we got:
I have moved the favicon into a header element -- one less route to override.
Other Information
Fixes #29578
To replicate the error, create a new rails app, on chrome run
rails sthen hard refresh should make a request for the favicon.Screenshot: