Skip to content

Instantly share code, notes, and snippets.

@hauleth
Created February 11, 2015 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hauleth/9542164d7f05573b021e to your computer and use it in GitHub Desktop.
Save hauleth/9542164d7f05573b021e to your computer and use it in GitHub Desktop.
class Listing < ActiveRecord::Base
if Rails.env.development?
has_attached_file :image, :styles => { :medium => "200x>", :thumb => "100x100>" }, :default_url => "404.png"
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]
else
has_attached_file :image, :styles => { :medium => "200x>", :thumb => "100x100>" }, :default_url => "404.png",
:storage => :dropbox,
:dropbox_credentials => Rails.root.join("config/dropbox.yml"),
:path => ":style/:id_:filename"
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment