Skip to content

Instantly share code, notes, and snippets.

@itsNikolay
Created February 4, 2012 17:55
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 itsNikolay/1739193 to your computer and use it in GitHub Desktop.
Save itsNikolay/1739193 to your computer and use it in GitHub Desktop.
class ContractFile < ActiveRecord::Base
belongs_to :contract, :polymorphic => true
has_attached_file :data,
:url => "/assets/paperclip/:parent_id/:attachment/:id/:style/:filename"
#:url => '/public/system/:attachment/foto_:basename.:extension',
#:url => '/assets/:id/foto_:basename.:extension'
validates_attachment_size :data, :less_than => 5.megabytes
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment