class ActionController::Base 
  # Ensure that all controllers have direct access to assert_request.
  include AssertRequest

  # In production mode, trap assert_request's RequestError exceptions, and
  # render a 404 response instead.
  def rescue_action_in_public_with_request_error(exception)
    if exception.kind_of? RequestError
      render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found"
    end
  end
  alias_method_chain :rescue_action_in_public, :request_error
  
end
class ActionController::Base 
  # Ensure that all controllers have direct access to assert_request.
  include AssertRequest

  # In production mode, trap assert_request's RequestError exceptions, and
  # render a 404 response instead.
  def rescue_action_in_public_with_request_error(exception)
    if exception.kind_of? RequestError
      respond_to do |type|
        type.html { render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" }
        type.all  { render :nothing => true, :status => "404 Not Found" }
      end
    end
  end
  alias_method_chain :rescue_action_in_public, :request_error
  
end
Make production responder friendly to non-HTML requests as well.
Make production responder friendly to non-HTML requests as well.


git-svn-id: 36d0598828eae866924735253b485a592756576c@8083 da5c320b-a5ec-0310-b7f9-e4d854caa1e2
