Paperclipも実際の画像データをデータベースのフィールド画像にアップロードしていました。私はデータベースのimage_file_nameフィールドにファイル名を保存するためにそれを調整する必要がありました。
ここにアップロードフォームから画像を保存するコントローラがあります。ここで
#paperclip replaces spaces with _
formatted_filename = params[:clothe][:image].original_filename
formatted_filename.gsub!(/\s/,'_')
#hook in image processing
#set type of upImg, formUpload (APIUpload, scrapeUpload, mobileUpload)
image = UploadImage.new(formatted_filename, Rails.root.to_s + '/public/products/', @clothe.id)
image.processImage
私のモデルは
class Product < ActiveRecord::Base
attr_accessible :description, :price, :title, :image, :image_file_name, :published
has_attached_file :image,
:styles => {
:thumb => "100x100#",
:small => "150x150>",
:medium => "200x200" },
:default_url => '/assets/missin.gif',
:path => Rails.root.to_s + "/public/products/:filename",
:url => "/products/published/:basename.:extension"
、特にdevelopment.logが参考になる、より多くの情報を提供してください。 – MoMolog
実際に私のアプリケーションの別のリンクを紹介しましたが、うまくいきます。ここでは、あなたが使用できるリンクがあります。http://codeabout.wordpress.com/2011/03/08/gem-paperclip-uploading-files-and-pictures-into -your-rails-application /ありがとう@MoMolog – Vic
あなたのコードも含めることができれば最高でしょう。 – thomasfedb