Skip to content

Instantly share code, notes, and snippets.

@joemsak
Created September 18, 2009 16:25
Show Gist options
  • Save joemsak/189152 to your computer and use it in GitHub Desktop.
Save joemsak/189152 to your computer and use it in GitHub Desktop.
class Photo < ActiveRecord::Base
belongs_to :gallery
has_attached_file :image,
:styles => { :large => "640x480>",
:medium => "150x150#",
:thumb => "75x75#" }
validates_attachment_presence :image
validates_attachment_content_type :image,
:content_type => ['image/jpeg', 'image/jpg']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment