A small difference, I admit, but nonetheless important. The dock here is good enough:
save!
Saved! checks are always performed. If any of these fail ActiveRecord :: RecordInvalid gets promoted.
save (perform_validation = true)
if perform_validation true verification is performed. If any of them does not work, the action is canceled, and the save returns false. If the flag is false, then checks are completely excluded. For more information, see ActiveRecord :: Validations.
So, with the exception! not just return true or false, but only return to success and raise an excpetion if it fails.
The purpose of this difference is that with save !, you can catch errors in your controller using standard ruby ββtools for this, while save allows you to do the same with standard if-clauses. At least that's what I think.
source share