R
R
Ruslan Galiev2015-10-19 23:41:01
Ruby on Rails
Ruslan Galiev, 2015-10-19 23:41:01

Rails Carrierwave S3 how to return a specific file if the requested file is not found on the server?

Hello
The situation is as follows: in order to save money, I want to change the life cycle of photos uploaded to s3 to 3 months. But at the same time, I do not want to delete entities on the Rails server. Is there simply an option to check when displaying a photo from s3, its presence and, if not, to display a pre-prepared layout "Photo deleted"? Suggest a solution.
Rails 3.2
Carrierwave 0.10

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jeiwan, 2015-10-20
@HerMajor

There is a method image.file.exists?where image is the field that stores the image.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question