carrierwave
https://github.com/carrierwaveuploader/carrierwave
Ruby
Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
CarrierWave::Uploader::Configuration::ClassMethods#storage=
Sets the storage engine to be used when storing files with this uploader.
Can be any class that implements a #store!(CarrierWave::SanitizedFile) and a #retrieve!
method. See lib/carrierwave/storage/file.rb for an example. Storage engines should
be added to CarrierWave::Uploader::Base.storage_engines so they can be referred
to by a symbol, which should be more convenient
If no argument is given, it will simply return the currently used storage engine.
=== Parameters
[storage (Symbol, Class)] The storage engine to use for this uploader
=== Returns
[Class] the storage engine to be used with this uploader
=== Examples
storage :file
storage CarrierWave::Storage::File
storage MyCustomStorageEngineEdit
git clone [email protected]:carrierwaveuploader/carrierwave.git
cd carrierwave
open lib/carrierwave/uploader/configuration.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-CarrierWave--Uploader--Configuration--ClassMethods-storage--for-pr
# Commit to gitgit add lib/carrierwave/uploader/configuration.rbgit commit -m "better docs for CarrierWave::Uploader::Configuration::ClassMethods#storage="
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-CarrierWave--Uploader--Configuration--ClassMethods-storage--for-pr
hub pull-request
# Celebrate!