diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application.rb | 7 | ||||
-rw-r--r-- | railties/test/railties/mounted_engine_routes_test.rb | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 3dba5f78a2..fb04351b35 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -50,6 +50,8 @@ module Rails end end + delegate :default_url_options, :default_url_options=, :to => :routes + # This method is called just after an application inherits from Rails::Application, # allowing the developer to load classes in lib and use them during application # configuration. @@ -121,11 +123,6 @@ module Rails alias :build_middleware_stack :app def call(env) - if Rails.application == self - env["ORIGINAL_SCRIPT_NAME"] = env["SCRIPT_NAME"] - env["action_dispatch.parent_routes"] = routes - end - env["action_dispatch.routes"] = routes app.call(env.reverse_merge!(env_defaults)) end diff --git a/railties/test/railties/mounted_engine_routes_test.rb b/railties/test/railties/mounted_engine_routes_test.rb index fe598b58b1..18789ab9e3 100644 --- a/railties/test/railties/mounted_engine_routes_test.rb +++ b/railties/test/railties/mounted_engine_routes_test.rb @@ -99,6 +99,9 @@ module ApplicationTests # test generating application's route from engine get "/someone/blog/generate_application_route" assert_equal "/", last_response.body + + # with script_name + Rails.application.default_url_options = {:script_name => "/foo"} get "/someone/blog/generate_application_route", {}, "SCRIPT_NAME" => "/foo" assert_equal "/foo/", last_response.body end |