Rails ActionController::favicon 的UnknownAction
我的 app/views/layouts/application.html.erb 中有以下行,
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
这会以某种方式导致日志中出现以下错误消息,并且未加载图标。这种情况仅发生在某些路径上,而不发生在整个应用程序上。
ActionController::UnknownAction (No action responded to images. Actions:
如何摆脱它?
I have following line in my app/views/layouts/application.html.erb
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
This somehow causes following error message int he logs and the favicon is not loaded. This happens only for certain paths not for the whole application.
ActionController::UnknownAction (No action responded to images. Actions:
How to get rid of it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请改用
favicon_link_tag
帮助程序:只需确保您的
favicon.ico
文件位于公共文件夹中...并且不要忘记正斜杠。Use the
favicon_link_tag
helper instead:Just make sure your
favicon.ico
file is in the public folder... and do not forget the forward slash.相信我..尝试在图像前加上斜线,这应该可以工作
Believe me.. try prefixing images with a slash and this should work