Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix generating params with optional defaults [#3404 state:resolved]

  • Loading branch information...
commit 61a31f3d3dae55b3ed2a49fafcbfe45b77ea3be2 1 parent 6ac32a8
@josh josh authored
View
2  actionpack/lib/action_dispatch/routing/deprecated_mapper.rb
@@ -175,7 +175,7 @@ def optionalize_trailing_dynamic_segments(path, requirements, defaults) #:nodoc:
optional = false
elsif segment =~ /^:(\w+)$/
if defaults.has_key?($1.to_sym)
- defaults.delete($1.to_sym)
+ defaults.delete($1.to_sym) if defaults[$1.to_sym].nil?
else
optional = false
end
View
4 actionpack/test/controller/routing_test.rb
@@ -1639,9 +1639,7 @@ def test_generate_with_default_params
map.connect ':controller/:action/:id'
end
- pending do
- assert_equal '/ibocorp', set.generate({:controller => 'ibocorp', :page => 1})
- end
+ assert_equal '/ibocorp', set.generate({:controller => 'ibocorp', :page => 1})
end
def test_generate_with_optional_params_recalls_last_request
Please sign in to comment.
Something went wrong with that request. Please try again.