Rework expansion of HTTP status code to work with rails 3

This commit is contained in:
Tom Hughes 2011-03-16 00:09:59 +00:00
parent c00a3e948a
commit f0d7c4a8d6

View file

@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base
request.headers['X-Error-Format'].downcase == "xml" request.headers['X-Error-Format'].downcase == "xml"
result = OSM::API.new.get_xml_doc result = OSM::API.new.get_xml_doc
result.root.name = "osmError" result.root.name = "osmError"
result.root << (XML::Node.new("status") << interpret_status(status)) result.root << (XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
result.root << (XML::Node.new("message") << message) result.root << (XML::Node.new("message") << message)
render :text => result.to_s, :content_type => "text/xml" render :text => result.to_s, :content_type => "text/xml"