From 00c0e4001cc875a51938a3086129b4dc275eef93 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Tue, 28 Nov 2017 15:58:18 +0000 Subject: Fix optimized url helpers when using relative url root Fixes #31220. --- actionpack/lib/action_dispatch/routing/route_set.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 987e709f6f..9eff30fa53 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -199,6 +199,16 @@ module ActionDispatch if args.size == arg_size && !inner_options && optimize_routes_generation?(t) options = t.url_options.merge @options options[:path] = optimized_helper(args) + + original_script_name = options.delete(:original_script_name) + script_name = t._routes.find_script_name(options) + + if original_script_name + script_name = original_script_name + script_name + end + + options[:script_name] = script_name + url_strategy.call options else super -- cgit v1.2.3