instance method
xml_http_request?
Ruby on Rails 8.1.2
Since v3.0.20Signature
xml_http_request?()
Returns true if the X-Requested-With header contains “XMLHttpRequest” (case-insensitive), which may need to be manually added depending on the choice of JavaScript libraries and frameworks.
Source
# File actionpack/lib/action_dispatch/http/request.rb, line 305
def xml_http_request?
/XMLHttpRequest/i.match?(get_header("HTTP_X_REQUESTED_WITH"))
end
Defined in actionpack/lib/action_dispatch/http/request.rb line 305
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Request