简体   繁体   中英

Config cloudinary for development and production

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.

您可以在上传器中使用类似以下的内容:

storage :file unless Rails.env == "production"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM