Sha256: be62a2f8c3be5d44ed752467c13fcec4b1742aa6267e4a545f67597700c1c837
Contents?: true
Size: 724 Bytes
Versions: 32
Compression:
Stored size: 724 Bytes
Contents
module Unpoly module Rails ## # Installs a `before_filter` into all controllers which echoes the # request's URL as a response header `X-Up-Location` and the request's # HTTP method as `X-Up-Method`. # # The Unpoly frontend requires these headers to detect redirects, # which are otherwise undetectable for an AJAX client. module RequestEchoHeaders def self.included(base) base.before_filter :set_up_request_echo_headers end private def set_up_request_echo_headers headers['X-Up-Location'] = request.original_url headers['X-Up-Method'] = request.method end ActionController::Base.send(:include, self) end end end
Version data entries
32 entries across 32 versions & 1 rubygems