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
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 of the default 500. Comment out the 
  # alias_method_chain call below if you don't want this behavior.
  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
Add comment about how to disable the current exception behavior in production (a 404 response).
Add comment about how to disable the current exception
behavior in production (a 404 response).


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