行,所以我有一個模型,在該模型中,我有回形針在validates_presence_of失敗
class User < ActiveRecord::Base
validates_presence_of :name
has_attached_file :picture, :styles => { :medium => "300x300>", :thumb => "100x100>",:tiny => "25x25>" }
end
當我創建一個用戶,並上傳一張照片,不輸入名稱我得到預期的消息
1 error prohibited this user from being saved.
There were problems with the following fields:
* Name can't be blank
但圖像消失......當我看到我的控制檯我看
[paperclip] identify -format %wx%h '/var/folders/QK/QK+tCPT-Gx8yGDxVQbDuF++++TI/-Tmp-/stream20110113-19714-1ucz75p-0.jpg[0]' 2>/dev/null
[paperclip] convert '/var/folders/QK/QK+tCPT-Gx8yGDxVQbDuF++++TI/-Tmp-/stream20110113-19714-1ucz75p-0.jpg[0]' -resize "25x25>" '/var/folders/QK/QK+tCPT-Gx8yGDxVQbDuF++++TI/-Tmp-/stream20110113-19714-1ucz75p-020110113-19714-r839l2-0' 2>/dev/null
但圖像消失在新的p年齡....有沒有一種方法來保存此圖像,以便任何人使用該頁面不必再次瀏覽圖像