Created
March 8, 2016 21:25
-
-
Save aflorezd/8ce0e94a93270f3e0f17 to your computer and use it in GitHub Desktop.
spreecommerce/solidus, use dropbox for storage images. (using gem paperclip-dropbox)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#initializer/dropbox_storage.rb | |
attachment_config = { | |
dropbox_credentials: Rails.root.join('config/dropbox.yml'), | |
storage: :dropbox, | |
styles: { | |
mini: "48x48>", | |
small: "100x100>", | |
product: "240x240>", | |
large: "600x600>" | |
}, | |
path: "/spree/products/:id/:style/:basename.:extension", | |
url: '/spree/products/:id/:style/:basename.:extension', | |
default_url: "/spree/products/:id/:style/:basename.:extension", | |
default_style: "product" | |
} | |
attachment_config.each do |key, value| | |
Spree::Image.attachment_definitions[:attachment][key.to_sym] = value | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment