Module: Jets::Controller::Decorate::Redirecting

Includes:
ApigwStage
Included in:
Base
Defined in:
lib/jets/controller/decorate/redirecting.rb

Instance Method Summary collapse

Methods included from ApigwStage

#add_apigw_stage, #add_apigw_stage?

Instance Method Details

#_compute_redirect_to_location(request, options) ⇒ Object

:nodoc:



5
6
7
8
9
# File 'lib/jets/controller/decorate/redirecting.rb', line 5

def _compute_redirect_to_location(request, options) # :nodoc:
  adjust = options.respond_to?(:to_str) || options.is_a?(String)
  options = add_apigw_stage(options) if adjust
  super
end

#redirect_back(fallback_location: '/') ⇒ Object



11
12
13
14
# File 'lib/jets/controller/decorate/redirecting.rb', line 11

def redirect_back(fallback_location: '/')
  location = request.headers["Referer"] || fallback_location
  redirect_to location
end