Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Upload < ActiveRecord::Base
- has_attached_file :document, styles: { thumbnail: "60x60#" }
- validates_attachment :document, content_type: { content_type: ["application/pdf","application/vnd.ms-excel",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
- "application/msword",
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
- "text/plain"] }
- validates :name, presence: true
- validates_format_of :email,:with => /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement