aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/url_for.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/url_for.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/url_for.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb
index 7f2c9a5c12..afbb2ecf16 100644
--- a/actionpack/lib/action_dispatch/routing/url_for.rb
+++ b/actionpack/lib/action_dispatch/routing/url_for.rb
@@ -101,7 +101,11 @@ module ActionDispatch
# end
def url_options
- self.class.default_url_options.merge(@url_options || {})
+ @url_options ||= begin
+ opts = self.class.default_url_options
+ opts.merge(:script_name => _router.script_name) if respond_to?(:_router)
+ opts
+ end
end
def url_options=(options)