1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Cache url_options on a per-request basis.

This commit is contained in:
thedarkone 2010-09-27 15:11:19 +02:00
parent 86bcccf8df
commit 8fdb34b237

View file

@ -5,6 +5,7 @@ module ActionController
include AbstractController::UrlFor
def url_options
@_url_options ||= begin
options = {}
if _routes.equal?(env["action_dispatch.routes"])
options[:script_name] = request.script_name.dup
@ -14,7 +15,8 @@ module ActionController
:host => request.host_with_port,
:protocol => request.protocol,
:_path_segments => request.symbolized_path_parameters
)
).freeze
end
end
end
end