diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2011-03-09 14:44:25 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2011-03-09 14:44:25 +0000 |
commit | 03cbd9672cfc142842c95aae0fb27b8eb27e6990 (patch) | |
tree | c1141b17caaf6185b19a47eb74e6d2a0ffe3971a /actionpack/lib/action_dispatch | |
parent | f41dd99be78e6e0243e9910aaab64ebd29bdad58 (diff) | |
download | rails-03cbd9672cfc142842c95aae0fb27b8eb27e6990.tar.gz rails-03cbd9672cfc142842c95aae0fb27b8eb27e6990.tar.bz2 rails-03cbd9672cfc142842c95aae0fb27b8eb27e6990.zip |
Filter params that return nil for to_param and allow through false values
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 535ff42b90..ac0fd9607d 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -41,7 +41,7 @@ module ActionDispatch path = options.delete(:path) || '' params = options[:params] || {} - params.reject! {|k,v| !v } + params.reject! {|k,v| v.to_param.nil? } rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path) rewritten_url << "?#{params.to_query}" unless params.empty? |