mardi 30 juin 2015

ruby on rails - 1 error prohibited this listing from being saved: Image has contents that are not what they are reported to be

1 error prohibited this listing from being saved: Image has contents that are not what they are reported to be

That's the error that I get when I try to upload a picture for a listing. I've tried various types of validations and nothing is working.

This is what my Model looks like.

class Listing < ActiveRecord::Base
    has_attached_file :image, :styles => { :medium => "200x", :thumb =>"100x100>" }, :default_url => "default.jpg"
    validates_attachment :image, content_type: { content_type: /\Aimage\/.*\Z/ }
end

Can someone please explain to me what I did wrong, and what I can do to fix it. I really want to keep working on this application but I've hit a problem!

Aucun commentaire:

Enregistrer un commentaire