Class ActionController::Integration::Session
In: lib/active_resource_integration_dsl.rb
Parent: Object

Methods

Public Instance methods

xhr(request_method, path, parameters = nil, headers = nil)

Alias for xml_http_request

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: dev.rubyonrails.org/ticket/7124

[Source]

     # File lib/active_resource_integration_dsl.rb, line 470
470:       def xml_http_request(request_method, path, parameters = nil, headers = nil) 
471:         unless request_method.is_a?(Symbol) 
472:           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.' 
473:             request_method, path, parameters, headers = :post, request_method, path, parameters
474:         end
475: 
476:         headers ||= {}
477:         headers['X-Requested-With'] = 'XMLHttpRequest'
478:         headers['Accept'] = 'text/javascript, text/html, application/xml, text/xml, */*'
479:         process(request_method, path, parameters, headers)
480:       end

[Validate]