0

In my app on rails I use carrierwave and cloudinary for upload images.

I set config file cloudinary.yml and all work well.

development:
  cloud_name: _my_app_name_
  api_key: '_my_cloudinary-key_'
  api_secret: _my_cloudinary_secret_
  enhance_image_tag: true
  static_image_support: false
production:
  cloud_name: _my_app_name_
  api_key: '_my_cloudinary-key_'
  api_secret: _my_cloudinary_secret_
  enhance_image_tag: true
  static_image_support: true
test:
  cloud_name: _my_app_name_
  api_key: '_my_cloudinary-key_'
  api_secret: _my_cloudinary_secret_
  enhance_image_tag: true
  static_image_support: false

How can I config cloudinary to use it only for production?

And for development use just local storage.

Jonny C
  • 1,943
  • 3
  • 20
  • 36
Kostya Kokosko
  • 45
  • 1
  • 11

1 Answers1

0

You can use something like the following in your uploader:

storage :file unless Rails.env == "production"
Itay Taragano
  • 1,901
  • 1
  • 11
  • 12