aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/url_for.rb2
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb2
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb4
3 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/url_for.rb b/actionpack/lib/action_controller/metal/url_for.rb
index e7eb7485c4..1e34f21c77 100644
--- a/actionpack/lib/action_controller/metal/url_for.rb
+++ b/actionpack/lib/action_controller/metal/url_for.rb
@@ -7,7 +7,7 @@ module ActionController
def url_options
options = {}
if _routes.equal?(env["action_dispatch.routes"])
- options[:script_name] = request.script_name
+ options[:script_name] = request.script_name.dup
end
super.merge(options).reverse_merge(
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index c67b0199ce..6e7e133cc5 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -307,7 +307,7 @@ module ActionDispatch
routes = self
MountedHelpers.class_eval do
define_method "_#{name}" do
- RoutesProxy.new(routes, (self.respond_to?(:controller) ? controller : self))
+ RoutesProxy.new(routes, self)
end
end
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index b8df2d9a69..f21cffea26 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -29,7 +29,9 @@ module ActionView
#
def url_options
return super unless controller.respond_to?(:url_options)
- controller.url_options
+ controller.send(:_with_routes, _routes) do
+ controller.url_options
+ end
end
# Returns the URL for the set of +options+ provided. This takes the