我用我的Rails 3.0應用程序的回形針爲了向用戶添加一個頭像,並且它不會保存圖像,因爲路徑關閉。繼承人我得到什麼:如何指定:路徑和:URL保存img在Paperclip,Rails 3.0.12
入門GET 「/profilepics/small/missing.png」 爲127.0.0.1於2012-04-11 23點38分29秒-0700
的ActionController :: RoutingError(無路由匹配「/profilepics/small/missing.png」):
我的用戶模型有:
has_attached_file :profilepic, :styles => { :small => "150x150>" }
我應該把爲:PATH => &:URL =>?
形式如下:
<% form_for @user, :html => { :multipart => true } do |f| %>
<%= f.file_field :profilepic %>
<% end %>
日誌是這樣的:
入門GET 「/system/profilepics/small/missing.png」 爲127.0.0.1在2012-04-12 00:33 :51 -0700
的ActionController :: RoutingError(無路由匹配 「/system/profilepics/small/missing.png」):
渲染/usr/lib/ruby/gems/1.9.1/gems/ ActionPack的-3.0.12/LIB/action_disp ATCH /中間件/模板/救援/救援內routing_error.erb /佈局(1.2ms的)
你可以添加你的表單嗎? – DanS 2012-04-12 07:02:30
你不一定需要指定:路徑或:網址,默認情況下,圖像保存到':rails_root/public/system /:attachment /:id /:style /:filename' – DanS 2012-04-12 07:09:10
我只是不斷得到一個破碎的img ( – Elias7 2012-04-12 07:10:56