# Problem with image\_tag

**URL:** <https://www.ruby-forum.com/t/problem-with-image-tag/119757>\
**Category:** Rails I18n\
**Created:** [November 10, 2007, 2:11am UTC](https://www.ruby-forum.com/t/problem-with-image-tag/119757 "2007-11-10T02:11:15Z")\
**Posts on this page:** 2\
**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:11am UTC](https://www.ruby-forum.com/t/problem-with-image-tag/119757/1 "2007-11-10T02:11:15Z")

</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 %\>  
…

---

<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/119757/2 "2007-11-10T02:12:21Z")

</div>

Just realized I posted this in the wrong forum! Please delete!
