display error message only when @record.errors is not empty