Class: ActionDispatch::Routing::OptionRedirect
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActionDispatch::Routing::Redirect
|
Defined in: | actionpack/lib/action_dispatch/routing/redirection.rb |
Class Method Summary
Instance Attribute Summary
Instance Method Summary
- #inspect
-
#options
Alias for Redirect#block.
- #path(params, request)
Redirect
- Inherited
Endpoint
- Inherited
Constructor Details
This class inherits a constructor from ActionDispatch::Routing::Redirect
Instance Method Details
#inspect
[ GitHub ]# File 'actionpack/lib/action_dispatch/routing/redirection.rb', line 143
def inspect "redirect(#{status}, #{ .map { |k, v| "#{k}: #{v}" }.join(', ')})" end
#options
Alias for Redirect#block.
# File 'actionpack/lib/action_dispatch/routing/redirection.rb', line 115
alias : :block
#path(params, request)
[ GitHub ]# File 'actionpack/lib/action_dispatch/routing/redirection.rb', line 117
def path(params, request) = { protocol: request.protocol, host: request.host, port: request.optional_port, path: request.path, params: request.query_parameters }.merge! if !params.empty? && [:path].match(/%\{\w*\}/) [:path] = ( [:path] % escape_path(params)) end unless [:host] || [:domain] if relative_path?( [:path]) [:path] = "/#{ [:path]}" [:script_name] = request.script_name elsif [:path].empty? [:path] = request.script_name.empty? ? "/" : "" [:script_name] = request.script_name end end ActionDispatch::Http::URL.url_for end