diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-12-17 10:20:19 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-12-17 10:20:19 -0600 |
commit | f23c2796ee4a217d48bcefbc0056aaab6b1b64fa (patch) | |
tree | 8809925d8ae65ef2828c96ad84719d153a2748ac /actionpack/lib/action_controller/routing | |
parent | 175cb7a963a31cf9caecdc40331df4cdc5aa86e2 (diff) | |
download | rails-f23c2796ee4a217d48bcefbc0056aaab6b1b64fa.tar.gz rails-f23c2796ee4a217d48bcefbc0056aaab6b1b64fa.tar.bz2 rails-f23c2796ee4a217d48bcefbc0056aaab6b1b64fa.zip |
When checking for the wrong routing method, ensure the environment is passed to recognize optimize [#1406 state:resolved]
Diffstat (limited to 'actionpack/lib/action_controller/routing')
-rw-r--r-- | actionpack/lib/action_controller/routing/recognition_optimisation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing/recognition_optimisation.rb b/actionpack/lib/action_controller/routing/recognition_optimisation.rb index 3b98b16683..ebc553512f 100644 --- a/actionpack/lib/action_controller/routing/recognition_optimisation.rb +++ b/actionpack/lib/action_controller/routing/recognition_optimisation.rb @@ -56,7 +56,7 @@ module ActionController result = recognize_optimized(path, environment) and return result # Route was not recognized. Try to find out why (maybe wrong verb). - allows = HTTP_METHODS.select { |verb| routes.find { |r| r.recognize(path, :method => verb) } } + allows = HTTP_METHODS.select { |verb| routes.find { |r| r.recognize(path, environment.merge(:method => verb)) } } if environment[:method] && !HTTP_METHODS.include?(environment[:method]) raise NotImplemented.new(*allows) |