There is no template error in Rails 4 when requesting format * / *;
I've seen these errors for a long time, but didn't find the problem:
ActionView::MissingTemplate: Missing template pages/home, application/home with {:locale=>[:en], :formats=>["*/*;"]}
The user agent is always MSIE6 (which is part of the reason I gave up earlier).
Playback: curl -H "Accept: */*;" -I http://localhost:5000
Does anyone know how to fix it?
EDIT
curl -H "Accept: */*" -I http://localhost:5000
works. This only doesn't work if the format is set to */*;
(note the comma).
UPDATE
I tried modifying Mime:ALL
as suggested in the comments but couldn't accept it at the same time */*
and */*;
. The solution I see is monkey fixing how requests are handled when there are no or malformed mime types, but I'm not sure how to do this. This answer provides a clue, but I don't have it yet.
ADDITIONAL UPDATE
I can still see these errors and more. New - with :formats=>["hc/url;*/*"]
(Firefox). I'm so surprised this is nobody's business, I don't think I have anything specific in my code that will lead to unusual errors.
source to share
gregkare just posted a fix on 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
Not really sure about the side effects, but seems to be working great now.
source to share