Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10797: 10797-003.patch

File 10797-003.patch, 1.2 kB (added by thomas.lee, 6 months ago)

Simplified the fix ever so slightly: apply with "patch -p1 <10797-003.patch"

  • a/actionpack/lib/action_controller/request.rb

    old new  
    674674            else 
    675675              top << {key => value}.with_indifferent_access 
    676676              push top.last 
     677              value = top[key] 
    677678            end 
    678679          else 
    679680            top << value 
  • a/actionpack/test/controller/request_test.rb

    old new  
    705705    expected = { "test2" => "value1" } 
    706706    assert_equal expected, ActionController::AbstractRequest.parse_request_parameters(input) 
    707707  end 
     708 
     709  def test_parse_params_with_array_prefix_and_hashes 
     710    input = { "a[][b][c]" => %w(d) } 
     711    expected = {"a" => [{"b" => {"c" => "d"}}]} 
     712    assert_equal expected, ActionController::AbstractRequest.parse_request_parameters(input) 
     713  end 
    708714end 
    709715 
    710716