Sha256: e27a532694af0377ed2e4b4b8d540adb12187a29eec73c56386891da7f6c6362
Contents?: true
Size: 484 Bytes
Versions: 68
Compression:
Stored size: 484 Bytes
Contents
# Backport the Rails 5 controller test methods to Rails 4 module BackportTest [:delete, :get, :post, :put, :patch].each do |http_action| define_method(http_action) do |*args| (action, rest) = *args rest ||= {} if rest[:xhr] @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' @request.env['HTTP_ACCEPT'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ') end super(action, rest[:params]) end end end
Version data entries
68 entries across 68 versions & 4 rubygems