我可以使用 Paperclip接受、 和s 的上传.pdf
,但无法正常工作。.gif
.jpeg
.doc
.xls
模型中的回形针代码如下所示:
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
这是迁移:
class AddAttachmentAvatarToDocuments < ActiveRecord::Migration
def self.up
add_column :documents, :avatar_file_name, :string
add_column :documents, :avatar_content_type, :string
add_column :documents, :avatar_file_size, :integer
add_column :documents, :avatar_updated_at, :datetime
end
def self.down
remove_column :documents, :avatar_file_name
remove_column :documents, :avatar_content_type
remove_column :documents, :avatar_file_size
remove_column :documents, :avatar_updated_at
end
end
我该如何解决这个问题?