ici est ce qui se passe quand je charge une image avec une URL absolue: http://dl.dropbox.com/u/331982/Help/Screen%20shot%202011-08-31%20at%2011.17.44%20AM%20copy.pngRuby on Rails + Paperclip + Facebox: chargement de l'image sous forme de texte au lieu de l'image
Ce qui est à l'origine de l'image ne doit pas être rendu comme une image ?
Est-ce un problème avec Facebox?
Voilà comment je fait le lien d'image:
<a href="images/stairs.jpg" rel="facebox">text</a>
comme sur le site http://defunkt.io/facebox/
La méthode de téléchargement:
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
qu'est-ce qui devrait être: type be? – NullVoxPopuli
il est actuellement configuré pour:: type => media.document.content_type – NullVoxPopuli
Je vais juste ajouter ma méthode de téléchargement ... – NullVoxPopuli