instance method
normalize_parameters
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18 PrivateSignature
normalize_parameters(value)
Convert nested Hashs to HashWithIndifferentAccess and replace file upload hashs with UploadedFile objects
Parameters
-
valuereq
Source
# File actionpack/lib/action_controller/request.rb, line 474
def normalize_parameters(value)
case value
when Hash
if value.has_key?(:tempfile)
upload = value[:tempfile]
upload.extend(UploadedFile)
upload.original_path = value[:filename]
upload.content_type = value[:type]
upload
else
h = {}
value.each { |k, v| h[k] = normalize_parameters(v) }
h.with_indifferent_access
end
when Array
value.map { |e| normalize_parameters(e) }
else
value
end
end
Defined in actionpack/lib/action_controller/request.rb line 474
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Request