A similar problem here, my solution was to make a comparison in def
validate :check_image_with_title def check_image_with_title if !ctitle.blank? and cimage.blank? #If ctitle IS NOT empty and cimage IS empty, add a custom error message errors.add :key, "You need an image to go with your title" return false else return true end end
source share