Can someone help me display an image from a database?
I am trying to create an image tag for an image located in a
database. The following action is located in the
@photo = Photo.find(params[:id])
:filename => @photo.name,
:type => @photo.content_type,
:disposition => "inline")
If I go to the url http://localhost:3000/show_photo/database_data/1,
the photo displays properly. However, when I insert the following in
my view, it displays the image's binary as text. Suggestions?
<%= image_tag("/show_photo/database_data/1", :alt => "Image") %>
I've also pasted my code at http://pastie.caboo.se/126726. Thanks!