Skip to content

Instantly share code, notes, and snippets.

@walidvb
Created November 23, 2014 13:46
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 walidvb/65ae97800b6de94ba329 to your computer and use it in GitHub Desktop.
Save walidvb/65ae97800b6de94ba329 to your computer and use it in GitHub Desktop.
config.paperclip_defaults = {
:storage => :fog,
:fog_credentials => {:provider => "Local", :local_root => "#{Rails.root}/public"},
:fog_directory => "/public",
:fog_host => 'localhost:3000'
}
class Artist < ActiveRecord::Base
has_attached_file :profile_picture,
:styles => {
:thumb => "100x100#",
:small => "150x150>",
:medium => "200x200" },
:path => "artists/:name/profile_:basename_:style.:extension",
:default_url => "/images/missing.jpg"
validates_attachment_content_type :profile_picture, :content_type => /\Aimage\/.*\Z/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment