这里是当我有绝对的URL加载图像会发生什么: http://dl.dropbox.com/u/331982/Help/Screen%20shot%202011-08-31%20at%2011.17.44%20AM%20copy.pngRuby on Rails的+回形针+ Facebox:图像加载文本,而不是图像
是什么原因造成不被呈现为图像的图像?
这是Facebox的问题吗?
这是我做图片链接:
<a href="images/stairs.jpg" rel="facebox">text</a>
就像在网站上http://defunkt.io/facebox/
下载方法:
def download
head(:not_found) and return if (media = Media.find_by_id(params[:id])).nil?
path = media.document.path(params[:style])
head(:bad_request) and return unless File.exist?(path) && params[:format].to_s == File.extname(path).gsub(/^\.+/, '')
send_file_options = { :disposition => 'inline', :type => media.document.content_type }
send_file_options = { :disposition => 'inline' } if File.extname(path) == ".swf" && media.document_content_type == "application/x-shockwave-flash"
case SEND_FILE_METHOD
when :apache then send_file_options[:x_sendfile] = true
when :nginx then head(:x_accel_redirect => path.gsub(Rails.root, ''), :content_type => send_file_options[:type]) and return
end
send_file(path, send_file_options)
end
应该:type be? – NullVoxPopuli
它目前设置为::type => media.document.content_type – NullVoxPopuli
我只是添加我的下载方法... – NullVoxPopuli