# Problem with image\_tag!

**URL:** <https://www.ruby-forum.com/t/problem-with-image-tag/196515>\
**Category:** Rails\
**Created:** [November 10, 2007, 2:12am UTC](https://www.ruby-forum.com/t/problem-with-image-tag/196515 "2007-11-10T02:12:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@djmook](https://www.ruby-forum.com/u/djmook)\
**Post date:** [November 10, 2007, 2:12am UTC](https://www.ruby-forum.com/t/problem-with-image-tag/196515/1 "2007-11-10T02:12:49Z")

</div>

I’ve been following a tutorial for Rails that goes through uploading  
images directly to databases. The problem is that using image\_tag keeps  
automatically appending .png to the end of the address.  
/classified/image/9 displays the image correctly, but the image  
/classified/image/9.png keeps being added to the view instead.

Thanks in advance!

classified\_controller.rb:  
…  
def image  
@image = Classified.find(params[:id])  
send\_data @image.picture, :filename =\> “pic.jpg”,  
:type =\> @image.content\_type, :disposition =\> “inline”  
end  
…

show.rhtml:  
…  
\<% unless @classified.picture.blank? %\>  
\<%= image\_tag(url\_for({:action =\> ‘image’, :id =\> @classified.id})) -%\>  
\<% end %\>  
…
