Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Photo < ActiveRecord::Base
- attr_accessible :album_id, :description, :photo
- belongs_to :album
- has_many :comments, :as => :commentable
- has_attached_file :photo, :styles => { :big => "683x512", :medium => "120x120#", :thumb => "50x50#" },
- :url => "/assets/photos/:id/:style/:basename.:extension",
- :path => ":rails_root/public/assets/photos/:id/:style/:basename.:extension"
- validates_attachment_size :photo, :less_than => 2.megabytes
- validates_attachment_content_type :photo, :content_type => [ 'image/jpeg', 'image/gif', 'image/png' ]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement