lib/active_resource_integration_dsl.rb
# This overrides the Rails builtin xml_http_request and is a temporary workaround
# to allow testing RESTful Ajaxy calls. The patch has been applied to Rails 2.0, so this
# can probably be removed from ARID when that's released.
#
# ==== See: http://dev.rubyonrails.org/ticket/7124
This overrides the Rails builtin xml_http_request and is a temporary workaround
to allow testing RESTful Ajaxy calls. The patch has been applied to Rails 2.0, so this
can probably be removed from ARID when that's released.


This overrides the Rails builtin xml_http_request and is a temporary workaround to allow testing RESTful Ajaxy calls . The patch has been applied to Rails 2 . 0 so this can probably be removed from ARID when that ' s released .
def xml_http_request(request_method, path, parameters = nil, headers = nil) 
        unless request_method.is_a?(Symbol) 
          ActiveSupport::Deprecation.warn 'xml_http_request now takes the request_method (:get, :post, etc.) as the first argument. It used to assume :post, so add the :post argument to your existing method calls to silence this warning.' 
            request_method, path, parameters, headers = :post, request_method, path, parameters
        end
        headers ||= {}
        headers['X-Requested-With'] = 'XMLHttpRequest'
        headers['Accept'] = 'text/javascript, text/html, application/xml, text/xml, */*'
        process(request_method, path, parameters, headers)
      end
def xml_http_request ( request_method , path , parameters = nil , headers = nil ) unless request_method . is_a? ( Symbol ) ActiveSupport :: Deprecation . warn 'xml_http_request now takes the request_method (:get, :post, etc.) as the first argument. It used to assume :post, so add the :post argument to your existing method calls to silence this warning.' request_method , path , parameters , headers = :post , request_method , path , parameters end headers ||= { } headers [ 'X-Requested-With' ] = 'XMLHttpRequest' headers [ 'Accept' ] = 'text/javascript, text/html, application/xml, text/xml, */*' process ( request_method , path , parameters , headers ) end
This overrides the Rails builtin xml_http_request and is a temporary workaround
to allow testing RESTful Ajaxy calls.
This overrides the Rails builtin xml_http_request and is a temporary workaround to allow testing RESTful Ajaxy calls .
request_method
path
parameters
headers