diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-04 20:09:15 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-04 20:09:15 +0000 |
commit | 40762a48732185ce344cde351dfc6f4a67941f09 (patch) | |
tree | ea6b92acbe7013525e12fba22eb1a3db87d1367e /actionpack/lib | |
parent | df70e28e037952c8dee8e66b3ae683e5976e4f1d (diff) | |
download | rails-40762a48732185ce344cde351dfc6f4a67941f09.tar.gz rails-40762a48732185ce344cde351dfc6f4a67941f09.tar.bz2 rails-40762a48732185ce344cde351dfc6f4a67941f09.zip |
Fixed default routing NoMethodError downcase for nil when default controller provided (closes #5400) [kajism@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 7b9bbc3b5a..ab15e66e5c 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -556,8 +556,11 @@ module ActionController end def match_extraction(next_capture) - hangon = (default ? "|| #{default.inspect}" : "if match[#{next_capture}]") - "params[:#{key}] = match[#{next_capture}].downcase #{hangon}" + if default + "params[:#{key}] = match[#{next_capture}] ? match[#{next_capture}].downcase : '#{default}'" + else + "params[:#{key}] = match[#{next_capture}].downcase if match[#{next_capture}]" + end end end |