views:

369

answers:

1

Hello, I have a paperclip attachment in one model, but I`m not saving the file in /public, but /assets. And when the user what to open the file I use the send_data() function, which makes the user to download the file.

My question is how can I show the file in other way (not nessecery to download)? So if the file is a image, I will see it directly in the browser without download.

Thanks!

+2  A: 

Try:

send_data foo, :disposition => 'inline'

This would tell the browser to just render the content, instead of prompting the user to save it.

… from http://apidock.com/rails/ActionController/Streaming/send_data

cwninja