Module: Unpoly::Rails::RequestEchoHeaders

Defined in:
lib/unpoly/rails/request_echo_headers.rb

Overview

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.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


12
13
14
# File 'lib/unpoly/rails/request_echo_headers.rb', line 12

def self.included(base)
  base.before_filter :set_up_request_echo_headers
end