Sha256: 7dc37fad304998ed2312b301b003c7b34e10a9a957c126dc67718321bec49c89

Contents?: true

Size: 528 Bytes

Versions: 4

Compression:

Stored size: 528 Bytes

Contents

module Trestle
  module Controller
    module Location
      extend ActiveSupport::Concern

      included do
        after_action :set_trestle_location_header
      end

      # The X-Trestle-Location header is set to indicate that the remote form has triggered
      # a new page URL (e.g. new -> show) without demanding a full page refresh.
      def set_trestle_location_header
        unless modal_request? || response.location
          headers["X-Trestle-Location"] = request.path
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.10.1 app/controllers/concerns/trestle/controller/location.rb
trestle-0.10.0 app/controllers/concerns/trestle/controller/location.rb
trestle-0.10.0.pre2 app/controllers/concerns/trestle/controller/location.rb
trestle-0.10.0.pre app/controllers/concerns/trestle/controller/location.rb