1.7.17. 오류 드롭 (up)

잘못된 데이터로 인해 양식을 제출하지 못하면 관련 모델에서 오류 배열을 사용할 수 있습니다.

1.7.17.1. 방법

1.7.17.1.1. attribute

이 오류에 대한 모델의 특성을 반환합니다.Returns attribute of the model to this error is related.

{{ account.errors.org_name.first.attribute }}
<!-- org_name -->
1.7.17.1.2. message

오류에 대한 설명을 반환합니다.

{{ account.errors.first.message }}
<!-- cannot be blank -->
1.7.17.1.3. value

오류가 관련된 특성의 값을 반환합니다.Returns value of the attribute to which the error is related.

{{ account.errors.org_name.first.value }}
 <!-- => "ACME Co." -->
1.7.17.1.4. to_str

오류에 대한 전체 설명을 반환합니다(특성 이름 포함)

{{ model.errors.first }}
<!-- => "Attribute can't be blank" -->