Is there any way to prevent validation messages appearing twice for Paperclip upload validations?
Here is my model:
has_attached_file :photo, :styles => { :thumb => "215x165" }, :default_url => "/images/:style/missing.png"
validates_attachment :photo, :presence => true,
:content_type => { :content_type => "image/jpg" },
:size => { :in => 0..0.5.megabytes }
Here is my view:
<% if @product.errors.any? %>
<p>The following errors were found:</p>
<ul>
<% @product.errors.full_messages.each do |message| %>
<li>- <%= message %></li>
<% end %>
</ul>
<% end %>
If I upload an invalid file I get the following error messages:
- Photo content type is invalid
- Photo is invalid
Is there any way to make just one of these show up? I have tried adding message: to the model. But then this just comes up twice too!
Thank you!