콘텐츠 유형 오류 메시지가 두 번 표시됩니다. 두 번째 오류를 어떻게 해결할 수 있습니까?Content_type이 두 번 표시되는 오류
@document.errors.delete(:document)
을하지만 그것은 두 가지 오류를 지 웁니다 : (나는 다른 포스트에서 본 것처럼)
Document content type is not an acceptable type of document only pdf
Document ["is not an acceptable type of document only pdf"]
나는이 일을 시도했다.
오류가 나는 t 디스플레이 단지 올바른을 JUS 수있는 방법
<ul class="ml-30">
<% @errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
<li>Please change a few things up and try submitting again.</li>
</ul>
을 발생했습니다 이것은 내가 오류를 표시하는 데 사용하는 코드는
validates_attachment_content_type :document, :content_type => ["application/pdf"], :message => 'is not an acceptable type of document only pdf'
이 내가 확인을 위해 사용하는 코드입니다 에러 메시지?
그게 유효성 검사 ...하지만 오류를 표시하는 데 사용하는 코드는 어디에 있습니까? 또한이 'validates_attachment_content_type' 유효성 검사는 무엇입니까? 어딘가에서 도서관에서 얻은 방법인가요? 확실히 표준 레일 검증이 아니기 때문에 :) 우리가 그 코드를 보여줄 수 있다면 - 아마 우리는 그것을 고칠 수 있습니다. –
@Flezcano 오류를 표시하는 위치에서보기 코드를 공유 할 수 있습니까? –
감사합니다. 편집을 참조하십시오. – Flezcano