class ActionDispatch::Request::Utils::ParamEncoder

def self.normalize_encode_params(params)

Convert nested Hash to HashWithIndifferentAccess.
:nodoc:
def self.normalize_encode_params(params)
  case params
  when Array
    handle_array params
  when Hash
    if params.has_key?(:tempfile)
      ActionDispatch::Http::UploadedFile.new(params)
    else
      hwia = ActiveSupport::HashWithIndifferentAccess.new
      params.each_pair do |key, val|
        hwia[key] = normalize_encode_params(val)
      end
      hwia
    end
  else
    params
  end
end