Missing template pages/index with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>["text/*"]
Every once in a while my app would throw the following error:
Missing template pages/index with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>["text/*"]
The weird thing is that pages/index is pretty much a static page with no logic.
class 开发者_高级运维PagesController < ApplicationController
def index
@pagetitle = "Homepage"
end
end
Does anybody know which browsers request the text/* format and how to replicate and/or fix this bug?
You can try this in your controller, if it helps:
before_filter :force_request_format_to_html
private
def force_request_format_to_html
request.format = :html
end
I'm using Mime::Type for this case in config/initializers/mime_types.rb.
Mime::Type.register "text/html", :html, %w( application/xhtml+xml text/* ), %w( xhtml )
精彩评论