Displaying 1 result from an estimated 1 matches for "abs_img_path".
2009 Nov 08
2
send_data with jpeg not working
I''m a newbie having trouble using send_data to send a jpeg file to the
browser for display in an html img tag. This is the relevant code
from my controller (photos_controller.rb):
def retrieve
@photo = Photo.find(params[:id])
send_data File.read(@photo.abs_img_path), :type => "image/
jpeg", :disposition => "inline"
end
def download
@photo = Photo.find(params[:id])
send_file @photo.abs_img_path, :type => "image/jpeg", :filename =>
@photo.filename
end
In my html.erb file I have the following tags:
<%= image_ta...