当预期参数缺失或类型不匹配时,从 expect!
中抛出。
params = ActionController::Parameters.new(a: {})
params.expect!(:a)
# => ActionController::ExpectedParameterMissing: param is missing or the value is empty or invalid: a
当预期参数缺失或类型不匹配时,从 expect!
中抛出。
params = ActionController::Parameters.new(a: {})
params.expect!(:a)
# => ActionController::ExpectedParameterMissing: param is missing or the value is empty or invalid: a