Module: Trestle::Controller::Location

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/concerns/trestle/controller/location.rb

Instance Method Summary collapse

Instance Method Details

#set_trestle_location_headerObject

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.


12
13
14
15
16
# File 'app/controllers/concerns/trestle/controller/location.rb', line 12

def set_trestle_location_header
  unless dialog_request? || response.location
    headers["X-Trestle-Location"] = request.path
  end
end

Do not use Turbolinks for redirects from a dialog request


19
20
21
# File 'app/controllers/concerns/trestle/controller/location.rb', line 19

def visit_location_with_turbolinks(location, action)
  super unless dialog_request?
end