instance method normalize_encode_params

Ruby on Rails 4.2.9

Since v4.0.13 Last seen in v4.2.9 Private

Available in: v4.0.13 v4.1.16 v4.2.9

Signature

normalize_encode_params(params)

Convert nested Hash to HashWithIndifferentAccess.

Parameters

params req
Source
# File actionpack/lib/action_dispatch/http/parameters.rb, line 47
      def normalize_encode_params(params)
        case params
        when Hash
          if params.has_key?(:tempfile)
            UploadedFile.new(params)
          else
            params.each_with_object({}) do |(key, val), new_hash|
              new_hash[key] = if val.is_a?(Array)
                val.map! { |el| normalize_encode_params(el) }
              else
                normalize_encode_params(val)
              end
            end.with_indifferent_access
          end
        else
          params
        end
      end

Defined in actionpack/lib/action_dispatch/http/parameters.rb line 47 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::Http::Parameters

Type at least 2 characters to search.

↑↓ navigate · open · esc close