我已经看到这些错误很长时间了,但没有发现问题:ActionView::MissingTemplate: Missing template pages/home, application/home with {:locale=>[:en], :formats=>["*/*;"]}
用户代理始终是 MSIE6(这是我之前放弃的部分原因)。
转载:curl -H "Accept: */*;" -I http://localhost:5000
有谁知道怎么修?
编辑 curl -H "Accept: */*" -I http://localhost:5000
作品。仅当格式设置为 */*;
时才起作用(注意分号)。
更新
我尝试修改 Mime:ALL
正如评论中所建议的那样,但无法同时接受 */*
和 */*;
同时。我看到的一个解决方案是在不存在或格式错误的 mime 类型时修补请求的处理方式,但我不确定如何处理。 This answer提供了一个线索,但我仍然没有。
更多更新
我仍然看到这些错误和更多。一个新的与 :formats=>["hc/url;*/*"]
(火狐)。我很惊讶这不会影响其他任何人,我认为我的代码中没有任何会导致不常见错误的特定内容。
最佳答案
gregkare 刚刚在 github 上发布了一个修复程序.
DEFAULT_RESPONSE_FORMAT = :html
before_filter :set_default_response_format
def set_default_response_format
request.format = DEFAULT_RESPONSE_FORMAT if request.format.to_sym.nil?
end
不完全确定副作用,但目前似乎效果很好。
关于ruby-on-rails - 请求格式时,Rails 4 中缺少模板错误 */*;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29999347/