# Displaying pics

**URL:** <https://www.ruby-forum.com/t/displaying-pics/130870>\
**Category:** Rails\
**Created:** [March 4, 2008, 2:27am UTC](https://www.ruby-forum.com/t/displaying-pics/130870 "2008-03-04T02:27:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@shaish](https://www.ruby-forum.com/u/shaish)\
**Post date:** [March 4, 2008, 2:27am UTC](https://www.ruby-forum.com/t/displaying-pics/130870/1 "2008-03-04T02:27:50Z")

</div>

hey, I try to display pics (jpg) from my db but all I get is the  
“white box”.  
The pic and all of its att look fine in the db.

It goes something like this:

in show.rhtml:  
\<%= image\_tag(url\_for(:controller =\> ‘upload\_controller’, :action =\>  
“getpicture”, :id =\> @picture.id)) %\>

in upload.controller.rb:  
def getpicture  
@picture = Picture.find(params[:id])  
send\_data(@picture.data,  
:filename =\> @picture.name,  
:type =\> @picture.content\_type,  
:disposition =\> “inline” )  
end

somebody has any idea ?  
thnx.

---

<div class="post-metadata">

**Author:** ![shaish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@shaish](https://www.ruby-forum.com/u/shaish)\
**Post date:** [March 4, 2008, 7:07am UTC](https://www.ruby-forum.com/t/displaying-pics/130870/2 "2008-03-04T07:07:37Z")

</div>

There is a alternate way to do this…  
i once did in that way…

I stored the images under the public folder and saved the path in the db  
or can do like this,

While accessing u can do like  
\<%= link\_to image\_tag("#{video.path\_to\_thumbnail\_image}"),  
video\_path(video) %\>  
where path\_to\_thumbnail\_image is a method to display the path of the  
thumbnail created from the video.

All the best.  
Ratnavel
