class ActionController::Parameters

def to_hash

safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"}
safe_params = params.permit(:name)

# => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash
params.to_hash
})
oddity: "Heavy stone crab"
name: "Senjougahara Hitagi",
params = ActionController::Parameters.new({

with all unpermitted keys removed.
Returns a safe Hash representation of the parameters
def to_hash
  to_h.to_hash
end