paperclip where to place the missing.png default image?

前端 未结 2 1681
日久生厌
日久生厌 2021-01-19 03:53

I use paperclip in my app, but my controller tests are failing because of:

BlogsControllerTest#test_should_update_blog:
Paperclip::AdapterRegistry::NoHandle         


        
2条回答
  •  梦谈多话
    2021-01-19 04:47

    For this line of code:

    Paperclip::Attachment.default_options[:default_url] = "/images/default_image.png"
    

    Paperclip is looking for images under /public/images/default_image.png

    update:

    so you have defined style big and thumb. Paperclip will look for img in public/images/thumb/default_image.png or public/images/big/default_image.png depending what style will you call in <% image_tag @model.image.url(:style) %>.

    update #2 (according to update #4 from author's question)

    gotcha! If you want model to use :default_url don't send :image in params. remove image from params and lets see how it goes`

提交回复
热议问题