Method: ActionDispatch::Routing::Redirect#call

Defined in:
actionpack/lib/action_dispatch/routing/redirection.rb

#call(env) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'actionpack/lib/action_dispatch/routing/redirection.rb', line 22

def call(env)
  ActiveSupport::Notifications.instrument("redirect.action_dispatch") do |payload|
    request = Request.new(env)
    response = build_response(request)

    payload[:status] = @status
    payload[:location] = response.headers["Location"]
    payload[:request] = request

    response.to_a
  end
end