Delivering static images through a CDN
Good Morning,
This time I want to share about using cloudinary to store our static images/assets, we need this if we want to deploy our app to heroku free account 😛 , I assume that you are already have a cloudinary account, if you don’t, you can create it here.
First of all , add cloudinary gem to your gemfile
gem ‘cloudinary’
then run bundle install
download your cloudinary.yml file here and put it on your app/config directory
to upload all your Ruby-on-Rails applications’ static images to Cloudinary, run:
rake cloudinary:sync_static
This Rake task finds all the images in all common public folders and in Rails Asset Pipeline’s image asset folders. Afterwards, it uploads all new and modified images to Cloudinary.
When you add new static images or change existing ones, all you need to do is re-run ‘rake cloudinary:sync_static’.
That’s it folks.. 😃
for more details please visit: