0

Is there a fallback option when using cloudinary_url() if Cloudinary is unavailable (such as when working in dev offline)?

In this particular case, I've uploaded my static assets to Cloudinary and am using cloudinary_url in my css to pull in the background image. e.g.:

background-image: cloudinary_url("background.jpg");

However if Cloudinary is unavailable, I would like this to fallback to /assets/images/background.jpg

Eric Norcross
  • 4,177
  • 4
  • 28
  • 53

1 Answers1

0

Cloudinary's Ruby GEM allows to easy deliver static images of Rails applications (with or without Asset Pipeline). You can control whether the image will be fetched from Cloudinary or locally, using the static_image_support flag in cloudinary.yml

Here's some more information with explanation on how to use static assets with Cloudinary: http://cloudinary.com/blog/how_to_deliver_your_static_images_through_a_cdn_in_ruby_on_rails

Itay Taragano
  • 1,901
  • 1
  • 11
  • 12