我已经在我的系统上成功设置了 Paperclip 和 ImageMagick,并且文件正在正确上传、调整大小并保存到正确的文件夹中。
我尝试在我的视图中显示这些图像:
<%= image_tag @customer.logo.url(:medium) %>
不显示图像。当我转到图像的直接网址时,我得到:
Routing Error
No route matches "/images/assets/logos/1/medium/corplogo.jpg" with {:method=>:get}
这是一个仍在开发中并在 Windows 上运行的本地服务器。我的表格是多部分的:
<% form_for @customer, :url => {:action => "update", :id => @customer}, :html => {:multipart => true, :id => "myform"} do |f| %>
------ 开发服务器 ------
处理 ApplicationController#index (for 127.0.0.1 at 2010-09-27 04:38:33) [G ET] 参数:{"1285570273"=>nil}
ActionController::RoutingError (没有路由匹配 "/images/assets/logos/1/medium/corplogo.jpg" 与 {:method=>:get}): haml (3.0.15) rails/./lib/sass/plugin /rack.rb:41:在“调用”中
渲染救援/布局 (not_found)
- - - 模型 - - -
has_attached_file :logo,
:url => "assets/logos/:id/:style/:basename.:extension",
:path => ":rails_root/public/assets/logos/:id/:style/:basename.:extension",
:styles => {:medium => "300x300>", :thumb => "100x100>" }