2010-02-25 18:05:10 -05:00
|
|
|
module ActionController
|
|
|
|
module UrlFor
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2010-08-03 13:36:53 -04:00
|
|
|
include AbstractController::UrlFor
|
2010-02-25 18:05:10 -05:00
|
|
|
|
2010-02-26 18:20:41 -05:00
|
|
|
def url_options
|
2010-09-27 15:14:18 -04:00
|
|
|
@_url_options ||= super.reverse_merge(
|
|
|
|
:host => request.host_with_port,
|
|
|
|
:protocol => request.protocol,
|
|
|
|
:_path_segments => request.symbolized_path_parameters
|
|
|
|
).freeze
|
|
|
|
|
|
|
|
if _routes.equal?(env["action_dispatch.routes"])
|
|
|
|
@_url_options.dup.tap do |options|
|
2010-09-27 09:11:19 -04:00
|
|
|
options[:script_name] = request.script_name.dup
|
2010-09-27 15:14:18 -04:00
|
|
|
options.freeze
|
2010-09-27 09:11:19 -04:00
|
|
|
end
|
2010-09-27 15:14:18 -04:00
|
|
|
else
|
|
|
|
@_url_options
|
2010-09-27 09:11:19 -04:00
|
|
|
end
|
2010-02-25 18:05:10 -05:00
|
|
|
end
|
|
|
|
end
|
2010-07-01 18:29:20 -04:00
|
|
|
end
|