diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-01 23:35:01 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:05 +0200 |
commit | 628b94fbc81cb02b753d0f717a875219853b5764 (patch) | |
tree | 1db9aed7699ce33b1907c381a9363e4cf31c4302 /railties/lib | |
parent | 28016d33b0f2e668ca59a912c7fb2d777e3cf0a3 (diff) | |
download | rails-628b94fbc81cb02b753d0f717a875219853b5764.tar.gz rails-628b94fbc81cb02b753d0f717a875219853b5764.tar.bz2 rails-628b94fbc81cb02b753d0f717a875219853b5764.zip |
Pass routes via env['action_dispatch.routes'], it's needed by routes to determine if it should generate prefix for mounted apps
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index fee99faf43..4ea828c549 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -125,10 +125,10 @@ module Rails end def env_defaults - @env_defaults ||= { + @env_defaults ||= super.merge({ "action_dispatch.parameter_filter" => config.filter_parameters, "action_dispatch.secret_token" => config.secret_token - } + }) end def initializers diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 41b0a764e2..22a1a15bf5 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -159,7 +159,13 @@ module Rails end def call(env) - app.call(env) + app.call(env.reverse_merge!(env_defaults)) + end + + def env_defaults + @env_defaults ||= { + "action_dispatch.routes" => routes + } end def routes |