Ticket #7047: fix_url_for_behavior_with_arrays.diff
| File fix_url_for_behavior_with_arrays.diff, 1.2 kB (added by jeremymcanally, 2 years ago) |
|---|
-
actionpack/test/controller/routing_test.rb
old new 90 90 puts "#{1 / per_url} url/s\n\n" 91 91 end 92 92 end 93 94 def test_route_with_array_param 95 assert_equal '/people/visit?array[]=1&array[]=2&array[]=3', rs.generate({:controller => 'people', :action => 'visit', :array => [1,2,3]}) 96 end 93 97 94 98 def test_route_with_colon_first 95 99 rs.draw do |map| -
actionpack/lib/action_controller/routing.rb
old new 1179 1179 1180 1180 options_as_params = options[:controller] ? { :action => "index" } : {} 1181 1181 options.each do |k, value| 1182 options_as_params[k] = value.to_param 1182 # We should treat Array's properly, but only if they're not the path 1183 options_as_params[k] = (value.class == Array && k.to_s != 'path') ? value : value.to_param 1183 1184 end 1184 1185 options_as_params 1185 1186 end