With paperclip, how can I change the image location to a “:parent_model_id/:id” folder format?

前端 未结 3 1536
太阳男子
太阳男子 2021-02-06 07:42

Given that I have a Listing model that has many images and each image has one attachment, how can I have the

3条回答
  •  终归单人心
    2021-02-06 08:00

    you need to pass a url and path attribute. look at this thoughtbot blog post for help. The way you have it is close, but you need to pass the listing_id i would assume, not the :id.

提交回复
热议问题