instance method
url_options
Ruby on Rails 4.0.13
Since v3.0.20Signature
url_options()
No documentation comment.
Source
# File actionpack/lib/action_controller/metal/url_for.rb, line 25
def url_options
@_url_options ||= super.reverse_merge(
:host => request.host,
:port => request.optional_port,
:protocol => request.protocol,
:_recall => request.symbolized_path_parameters
).freeze
if (same_origin = _routes.equal?(env["action_dispatch.routes"])) ||
(script_name = env["ROUTES_#{_routes.object_id}_SCRIPT_NAME"]) ||
(original_script_name = env['ORIGINAL_SCRIPT_NAME'])
@_url_options.dup.tap do |options|
if original_script_name
options[:original_script_name] = original_script_name
else
options[:script_name] = same_origin ? request.script_name.dup : script_name
end
options.freeze
end
else
@_url_options
end
end
Defined in actionpack/lib/action_controller/metal/url_for.rb line 25
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::UrlFor