Ruby Forum Rails I18n > Problem with image_tag

Posted by Mark Chandler (chandlerm)
on 10.11.2007 02:11
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 %>
...
Posted by Mark Chandler (chandlerm)
on 10.11.2007 02:12
Just realized I posted this in the wrong forum! Please delete!