這裏是當我有絕對的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