This is the start of bunch of (hopefully) regular small posts with snippets for ruby and
rails. It’s supposed to be about those little things I keep looking up again and
again.
so back to topic: Making a rails model save fail!
- Add something to the errors in the validation
https://gist.github.com/4574361.js
- Make a before_filter fail (eg. before_create, …)
Return false in a before_filter, will cause the model save to fail