diff options
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r-- | railties/lib/rails/application.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 4ea828c549..3dba5f78a2 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -121,14 +121,20 @@ 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 def env_defaults - @env_defaults ||= super.merge({ + @env_defaults ||= { "action_dispatch.parameter_filter" => config.filter_parameters, "action_dispatch.secret_token" => config.secret_token - }) + } end def initializers |