Dragonfly::Cloudinary
Simple Cloudinary data store for Dragonfly.
Installation
Add this line to your application's Gemfile:
gem 'dragonfly-cloudinary'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dragonfly-cloudinary
Usage
Set up Cloudinary account, download your cloudinary.yml, and add this to your dragonfly initializer:
app = Dragonfly[:images]
app.datastore = Dragonfly::DataStorage::CloudinaryStore.new
You don't need to configure datastore itself, it will use your cloudinary settings.
Cloudinary urls
You can generate direct urls for stored image in cloudinary using image.remote_url
. See Dragonfly documentation for this.
You can pass any options that cloudinary supports, e.g. image.remote_url(width: 100, height: 100, crop: :crop)
. See more at Cloudinary documentation
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request