instance method interpolate_path

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

interpolate_path(template, params)

A decoded param must not give the target a scheme or host that the template lacks, or the redirect would leave the request’s host.

Parameters

template req
params req
Source
# File actionpack/lib/action_dispatch/routing/redirection.rb, line 119
        def interpolate_path(template, params)
          path = template % escape_path(params)
          return path if template.match?(SCHEME_OR_AUTHORITY)

          if path.start_with?("//")
            path.sub("//", "/%2F")
          elsif path.match?(SCHEME_OR_AUTHORITY)
            "/#{path.sub(":", "%3A")}"
          else
            path
          end
        end

Defined in actionpack/lib/action_dispatch/routing/redirection.rb line 119 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::Routing::PathRedirect

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close