2011-08-31 3 views
0

내가 절대 URL로 이미지를로드 할 때 발생하는 것입니다 대신 이미지의 텍스트로 : 이미지로 렌더링 할 수없는 이미지의 원인이 무엇 http://dl.dropbox.com/u/331982/Help/Screen%20shot%202011-08-31%20at%2011.17.44%20AM%20copy.png루비 : 이미지로드 여기

?

Facebox에 문제가 있습니까?

내가 이미지 링크 만든 방법입니다

<a href="images/stairs.jpg" rel="facebox">text</a> 

그냥 웹 사이트에서 맘을 http://defunkt.io/facebox/

다운로드 방법 :

이 MIME 타입의 오류처럼 보이는
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 

답변

0

HTML 또는 HTML로 해석되는 것으로 반환합니다. send_file을 사용하는 경우 응답 MIME 유형을 설정해야합니다. send_file에 대한 :type 옵션입니다.

+0

무엇을해야합니까? – NullVoxPopuli

+0

현재 : : type => media.document.content_type – NullVoxPopuli

+0

방금 ​​다운로드 방법을 추가하겠습니다 ... – NullVoxPopuli