Skip to content

Instantly share code, notes, and snippets.

@aflorezd
Created March 8, 2016 21:25
Show Gist options
  • Save aflorezd/8ce0e94a93270f3e0f17 to your computer and use it in GitHub Desktop.
Save aflorezd/8ce0e94a93270f3e0f17 to your computer and use it in GitHub Desktop.
spreecommerce/solidus, use dropbox for storage images. (using gem paperclip-dropbox)
#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