Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Distinguish Validation Exceptions in Rails 3
- begin
- new_user = User.new
- new_user.name = new_user_name
- new_user.email = new_user_email
- new_user.password = new_user_password
- new_user.password_confirmation = new_user_password
- new_user.save!
- rescue PasswordTooShortException
- render :status => 452 and return
- rescue EmailAlreadyTakenException
- render :status => 453 and return
- end
Add Comment
Please, Sign In to add comment