Displaying 1 result from an estimated 1 matches for "image_datatyp".
Did you mean:
image_datatype
2010 Dec 22
0
image_tag and send_data
...on in controller:
def image
begin
item = StoredItem.find(:first, :conditions => {:id =>
params[:id]})
rescue
return
end
return if item.nil?
if item.image_binary.nil?
render :nothing => true
else
send_data(item.image_binary, :type => item.image_datatype,
:disposition => ''inline'') unless item.image_binary.nil?
end
end
and i have this code in view:
<%items.each do |item|%>
...
<%=image_tag(url_for(:action => :image, :id => item.id), :alt =>
item.name+'' image'', :size => ''24...