views:

71

answers:

1

I'm using Papeclip(2.3.1.1) with Rails(2.3.5). In my view I write so:

<%= link_to image_tag(p.attachment.url(:small)), p.attachment.url(:original) %>,

and it becomes into

href="/system/attachments/1/original/1.JPG?1270134617 (for a tag)

src="/system/attachments/1/small/1.JPG?1270134617" (for img tag).

And when I click on the picture, my browser (Firefox) offers me to save or open picture and I want to just open picture in browser without any dialogs. I think it's because link contains ?1270134617 after file's name. How can I fix it?

A: 

This could be related with the mime types.

Go to /config/initializers/mime_types.rb, and add (or uncomment, if it's there) this line:

Mime::Type.register "image/jpg", :jpg, ["image/jpeg", "image/pjpeg"]

Then restart your web server.

Hopefully this will make the picture "show on the browser" instead of "trying to download it".

egarcia