class ActionController::Parameters

def dig(*keys)

params2.dig(:foo, 1) # => 11
params2 = ActionController::Parameters.new(foo: [10, 11, 12])

params.dig(:foo, :zot, :xyz) # => nil
params.dig(:foo, :bar, :baz) # => 1
params = ActionController::Parameters.new(foo: { bar: { baz: 1 } })

at each step. Returns +nil+ if any intermediate step is +nil+.
Extracts the nested parameter from the given +keys+ by calling +dig+
def dig(*keys)
  convert_hashes_to_parameters(keys.first, @parameters[keys.first])
  @parameters.dig(*keys)
end